feat(bigquery-jdbc): support picosecond timestamps in Arrow Storage Read API and nested types - #14332
feat(bigquery-jdbc): support picosecond timestamps in Arrow Storage Read API and nested types#14332keshavdandeva wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for picosecond timestamp precision when retrieving Arrow data in the BigQuery JDBC driver. It propagates the enableTimestampPicos flag through BigQueryArrowArray, BigQueryArrowResultSet, and BigQueryArrowStruct, configures the Arrow serialization options in BigQueryStatement, and formats timestamps with high precision when enabled. Comprehensive unit tests are also added to verify this behavior. The review feedback suggests improving the robustness of getRangeElementType in BigQueryArrowResultSet by standardizing the type name to uppercase and adding a null check to prevent a potential NullPointerException when range bounds are unbounded.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for picosecond timestamp precision when reading Arrow data in the BigQuery JDBC driver. It propagates the 'enableTimestampPicos' flag across Arrow-related classes (BigQueryArrowArray, BigQueryArrowResultSet, BigQueryArrowStruct), configures ArrowSerializationOptions in BigQueryStatement, and updates BigQueryTemporalUtility to format timestamps with up to 12 fractional digits. The review feedback suggests making the range element type resolution more robust by converting the type string to uppercase before parsing, and warns about potential memory leaks in the unit tests due to unclosed RootAllocator and VectorSchemaRoot instances.
…ead API and nested types
0fdf436 to
7235227
Compare
b/544839155
This PR enables picosecond precision (
TIMESTAMP(12)) support across the BigQuery Storage Read API (Arrow stream) and nested data structures (ARRAY,STRUCT, andRANGE) whenEnableTimestampPicos=true.Key Changes
TableReadOptions.arrowSerializationOptionswithTIMESTAMP_PRECISION_PICOSinBigQueryStatementwhenEnableTimestampPicosis active.enableTimestampPicosintoBigQueryArrowResultSet, formatting picosecond timestamps directly to 12 fractional digits for column retrieval.Textinstances toStringacross hot paths to prevent downstreamBigQueryTypeRegistryconversion failures.RANGEand nestedRANGEbounds using schema-derived element types and precision flags.BigQueryArrowArrayandBigQueryArrowStruct.getTargetClass()inBigQueryArrowArrayto returnString.classwhen picoseconds are enabled, preventingArray.newInstancemismatch exceptions.BigQueryArrowResultSet,BigQueryArrowArrayOfPrimitives,BigQueryArrowStruct, andBigQueryStatement.