From e7fccb2ddb4e372b4d65582bcca5cbfc192f471d Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 13 Oct 2026 03:40:07 +0000 Subject: [PATCH 1/2] fix(bigquery): propagate DataFormatOptions to listTableData/getQueryResults and FieldValue --- .../google/cloud/bigquery/BigQueryImpl.java | 18 +++---- .../cloud/bigquery/BigQueryOptions.java | 3 -- .../com/google/cloud/bigquery/FieldValue.java | 49 ++++++++++++------- .../google/cloud/bigquery/FieldValueList.java | 9 ++-- .../bigquery/spi/v2/HttpBigQueryRpc.java | 16 ++++++ .../cloud/bigquery/FieldValueListTest.java | 13 +++-- .../google/cloud/bigquery/FieldValueTest.java | 10 ++-- .../bigquery/spi/v2/HttpBigQueryRpcTest.java | 35 +++++++++++++ 8 files changed, 110 insertions(+), 43 deletions(-) diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 586becb710b2..f16581d2d645 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -2208,9 +2208,7 @@ public TableDataList call() throws IOException { new TableDataPageFetcher(tableId, schema, serviceOptions, cursor, pageOptionMap), cursor, transformTableData( - result.getRows(), - schema, - serviceOptions.getDataFormatOptions().useInt64Timestamp())), + result.getRows(), schema, serviceOptions.getDataFormatOptions())), result.getTotalRows()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -2218,7 +2216,9 @@ public TableDataList call() throws IOException { } private static Iterable transformTableData( - Iterable tableDataPb, final Schema schema, boolean useInt64Timestamps) { + Iterable tableDataPb, + final Schema schema, + final DataFormatOptions dataFormatOptions) { return ImmutableList.copyOf( Iterables.transform( tableDataPb != null ? tableDataPb : ImmutableList.of(), @@ -2227,7 +2227,7 @@ private static Iterable transformTableData( @Override public FieldValueList apply(TableRow rowPb) { - return FieldValueList.fromPb(rowPb.getF(), fields, useInt64Timestamps); + return FieldValueList.fromPb(rowPb.getF(), fields, dataFormatOptions); } })); } @@ -2485,9 +2485,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() new QueryPageFetcher(jobId, schema, getOptions(), cursor, optionMap(options)), cursor, transformTableData( - results.getRows(), - schema, - getOptions().getDataFormatOptions().useInt64Timestamp()))) + results.getRows(), schema, getOptions().getDataFormatOptions()))) .setJobId(jobId) .setRowsInPage(results.getRows() != null ? (long) results.getRows().size() : 0L) .build(); @@ -2500,9 +2498,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), null, transformTableData( - results.getRows(), - schema, - getOptions().getDataFormatOptions().useInt64Timestamp()))) + results.getRows(), schema, getOptions().getDataFormatOptions()))) // Return the JobID of the successful job .setJobId( results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null) diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index b8b7994f8775..2adc02f97e7e 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -41,7 +41,6 @@ public class BigQueryOptions extends ServiceOptions { private final String location; // set the option ThrowNotFound when you want to throw the exception when the value not found private boolean setThrowNotFound; - private boolean useInt64Timestamps; private DataFormatOptions dataFormatOptions; private JobCreationMode defaultJobCreationMode = JobCreationMode.JOB_CREATION_MODE_UNSPECIFIED; private boolean enableOpenTelemetryTracing; @@ -172,7 +171,6 @@ public BigQueryOptions build() { private BigQueryOptions(Builder builder) { super(BigQueryFactory.class, BigQueryRpcFactory.class, builder, new BigQueryDefaults()); this.location = builder.location; - this.useInt64Timestamps = builder.useInt64Timestamps; this.enableOpenTelemetryTracing = builder.enableOpenTelemetryTracing; this.openTelemetryTracer = builder.openTelemetryTracer; if (builder.resultRetryAlgorithm != null) { @@ -249,7 +247,6 @@ public void setThrowNotFound(boolean setThrowNotFound) { */ @ObsoleteApi("Use Builder#setDataFormatOptions(DataFormatOptions) instead") public void setUseInt64Timestamps(boolean useInt64Timestamps) { - this.useInt64Timestamps = useInt64Timestamps; // Because this setter exists outside the Builder, DataFormatOptions needs be rebuilt to // account for this setting. this.dataFormatOptions = diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index d11df4b956af..1eec287eb72a 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -26,7 +26,6 @@ import com.google.common.io.BaseEncoding; import java.io.Serializable; import java.math.BigDecimal; -import java.math.BigInteger; import java.math.RoundingMode; import java.time.Duration; import java.time.Instant; @@ -76,13 +75,14 @@ public enum Attribute { } private FieldValue(Attribute attribute, Object value) { - this(attribute, value, false); + this(attribute, value, DataFormatOptions.newBuilder().build()); } - private FieldValue(Attribute attribute, Object value, Boolean useInt64Timestamps) { + private FieldValue(Attribute attribute, Object value, DataFormatOptions dataFormatOptions) { this.attribute = checkNotNull(attribute); this.value = value; - this.useInt64Timestamps = useInt64Timestamps; + this.useInt64Timestamps = + dataFormatOptions != null && dataFormatOptions.useInt64Timestamp(); } /** @@ -219,10 +219,14 @@ public boolean getBooleanValue() { @SuppressWarnings("unchecked") public long getTimestampValue() { if (useInt64Timestamps) { - return new BigInteger(getStringValue()).longValue(); + // When useInt64Timestamp is enabled, the backend returns timestamps as signed 64-bit integer + // (INT64) microseconds since epoch (e.g. "1408452095220000"), which always fits within a + // primitive long. Parse directly with Long.parseLong to avoid allocating a BigInteger per + // cell. + return Long.parseLong(getStringValue()); } - // timestamps are encoded in the format 1408452095.22 where the integer part is seconds since - // epoch (e.g. 1408452095.22 == 2014-08-19 07:41:35.220 -05:00) + // By default (useInt64Timestamp = false), timestamps are encoded as floating-point seconds + // since epoch (e.g. 1408452095.22 == 2014-08-19 07:41:35.220 -05:00). BigDecimal secondsWithMicro = new BigDecimal(getStringValue()); // Rounding the BigDecimal to the nearest whole number before setting the longValue in order to // address TimeStamp rounding issue described in @@ -370,22 +374,33 @@ public final boolean equals(Object obj) { */ @BetaApi public static FieldValue of(Attribute attribute, Object value) { - return of(attribute, value, false); + return of(attribute, value, DataFormatOptions.newBuilder().build()); } @BetaApi public static FieldValue of(Attribute attribute, Object value, Boolean useInt64Timestamps) { - return new FieldValue(attribute, value, useInt64Timestamps); + return of( + attribute, + value, + DataFormatOptions.newBuilder() + .useInt64Timestamp(Boolean.TRUE.equals(useInt64Timestamps)) + .build()); + } + + static FieldValue of( + Attribute attribute, Object value, DataFormatOptions dataFormatOptions) { + return new FieldValue(attribute, value, dataFormatOptions); } static FieldValue fromPb(Object cellPb) { - return fromPb(cellPb, null, false); + return fromPb(cellPb, null, DataFormatOptions.newBuilder().build()); } @SuppressWarnings("unchecked") - static FieldValue fromPb(Object cellPb, Field recordSchema, Boolean useInt64Timestamps) { + static FieldValue fromPb( + Object cellPb, Field recordSchema, DataFormatOptions dataFormatOptions) { if (Data.isNull(cellPb)) { - return FieldValue.of(Attribute.PRIMITIVE, null, useInt64Timestamps); + return FieldValue.of(Attribute.PRIMITIVE, null, dataFormatOptions); } if (cellPb instanceof String) { if ((recordSchema != null) @@ -394,14 +409,14 @@ static FieldValue fromPb(Object cellPb, Field recordSchema, Boolean useInt64Time return FieldValue.of( Attribute.RANGE, Range.of((String) cellPb, recordSchema.getRangeElementType()), - useInt64Timestamps); + dataFormatOptions); } - return FieldValue.of(Attribute.PRIMITIVE, cellPb, useInt64Timestamps); + return FieldValue.of(Attribute.PRIMITIVE, cellPb, dataFormatOptions); } if (cellPb instanceof List) { return FieldValue.of( Attribute.REPEATED, - FieldValueList.fromPb((List) cellPb, null, useInt64Timestamps)); + FieldValueList.fromPb((List) cellPb, null, dataFormatOptions)); } if (cellPb instanceof Map) { Map cellMapPb = (Map) cellPb; @@ -410,12 +425,12 @@ static FieldValue fromPb(Object cellPb, Field recordSchema, Boolean useInt64Time return FieldValue.of( Attribute.RECORD, FieldValueList.fromPb( - (List) cellMapPb.get("f"), subFieldsSchema, useInt64Timestamps)); + (List) cellMapPb.get("f"), subFieldsSchema, dataFormatOptions)); } // This should never be the case when we are processing a first level table field (i.e. a // row's field, not a record sub-field) if (cellMapPb.containsKey("v")) { - return FieldValue.fromPb(cellMapPb.get("v"), recordSchema, useInt64Timestamps); + return FieldValue.fromPb(cellMapPb.get("v"), recordSchema, dataFormatOptions); } } throw new IllegalArgumentException("Unexpected table cell format"); diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java index 18d2155a583f..a44a460761b4 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java @@ -112,10 +112,11 @@ FieldValueList withSchema(FieldList schema) { } static FieldValueList fromPb(List rowPb, FieldList schema) { - return fromPb(rowPb, schema, false); + return fromPb(rowPb, schema, DataFormatOptions.newBuilder().build()); } - static FieldValueList fromPb(List rowPb, FieldList schema, Boolean useInt64Timestamps) { + static FieldValueList fromPb( + List rowPb, FieldList schema, DataFormatOptions dataFormatOptions) { List row = new ArrayList<>(rowPb.size()); if (schema != null) { if (schema.size() != rowPb.size()) { @@ -124,11 +125,11 @@ static FieldValueList fromPb(List rowPb, FieldList schema, Boolean useInt64Ti Iterator schemaIter = schema.iterator(); Iterator rowPbIter = rowPb.iterator(); while (rowPbIter.hasNext() && schemaIter.hasNext()) { - row.add(FieldValue.fromPb(rowPbIter.next(), schemaIter.next(), useInt64Timestamps)); + row.add(FieldValue.fromPb(rowPbIter.next(), schemaIter.next(), dataFormatOptions)); } } else { for (Object cellPb : rowPb) { - row.add(FieldValue.fromPb(cellPb, null, useInt64Timestamps)); + row.add(FieldValue.fromPb(cellPb, null, dataFormatOptions)); } } diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 41fe993b204e..8ba7d2cd2760 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -1424,6 +1424,14 @@ public TableDataList listTableDataSkipExceptionTranslation( .tabledata() .list(projectId, datasetId, tableId) .setPrettyPrint(false) + .setFormatOptionsUseInt64Timestamp( + this.options.getDataFormatOptions() != null + ? this.options.getDataFormatOptions().useInt64Timestamp() + : null) + .setFormatOptionsTimestampOutputFormat( + this.options.getDataFormatOptions() != null + ? this.options.getDataFormatOptions().timestampFormatOptions().toString() + : null) .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)) .setStartIndex( @@ -1827,6 +1835,14 @@ public GetQueryResultsResponse getQueryResultsSkipExceptionTranslation( .jobs() .getQueryResults(projectId, jobId) .setPrettyPrint(false) + .setFormatOptionsUseInt64Timestamp( + this.options.getDataFormatOptions() != null + ? this.options.getDataFormatOptions().useInt64Timestamp() + : null) + .setFormatOptionsTimestampOutputFormat( + this.options.getDataFormatOptions() != null + ? this.options.getDataFormatOptions().timestampFormatOptions().toString() + : null) .setLocation(location) .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)) diff --git a/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java b/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java index dd5092b1c102..11c4b9225f12 100644 --- a/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java +++ b/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java @@ -75,16 +75,19 @@ class FieldValueListTest { ImmutableMap.of( "v", "99999999999999999999999999999999999999.99999999999999999999999999999999999999"); + private final DataFormatOptions losslessOptions = + DataFormatOptions.newBuilder().useInt64Timestamp(true).build(); private final FieldValue booleanFv = FieldValue.of(Attribute.PRIMITIVE, "false"); private final FieldValue booleanLosslessTimestampFv = - FieldValue.of(Attribute.PRIMITIVE, "false", true); + FieldValue.of(Attribute.PRIMITIVE, "false", losslessOptions); private final FieldValue integerFv = FieldValue.of(Attribute.PRIMITIVE, "1"); private final FieldValue integerLosslessTimestampFv = - FieldValue.of(Attribute.PRIMITIVE, "1", true); + FieldValue.of(Attribute.PRIMITIVE, "1", losslessOptions); private final FieldValue floatFv = FieldValue.of(Attribute.PRIMITIVE, "1.5"); private final FieldValue stringFv = FieldValue.of(Attribute.PRIMITIVE, "string"); private final FieldValue timestampFv = FieldValue.of(Attribute.PRIMITIVE, "42"); - private final FieldValue losslessTimestampFv = FieldValue.of(Attribute.PRIMITIVE, "42", true); + private final FieldValue losslessTimestampFv = + FieldValue.of(Attribute.PRIMITIVE, "42", losslessOptions); private final FieldValue bytesFv = FieldValue.of(Attribute.PRIMITIVE, BYTES_BASE64); private final FieldValue nullFv = FieldValue.of(Attribute.PRIMITIVE, null); private final FieldValue repeatedFv = @@ -144,11 +147,11 @@ void testFromPb() { // Schema does not influence values equality assertEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, null)); - assertNotEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, null, true)); + assertNotEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, null, losslessOptions)); assertEquals( fieldValuesLosslessTimestamp, - FieldValueList.fromPb(fieldValuesLosslessTimestampPb, null, true)); + FieldValueList.fromPb(fieldValuesLosslessTimestampPb, null, losslessOptions)); } @Test diff --git a/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index e6b08ec6b8a3..d36544ee508e 100644 --- a/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -134,18 +134,20 @@ public void testTimestamp() { @Test public void testInt64Timestamp() { + DataFormatOptions losslessOptions = + DataFormatOptions.newBuilder().useInt64Timestamp(true).build(); FieldValue lossyFieldValue = FieldValue.of(FieldValue.Attribute.PRIMITIVE, "1.9954383398377106E10"); long lossy = lossyFieldValue.getTimestampValue(); FieldValue losslessFieldValue = - FieldValue.of(FieldValue.Attribute.PRIMITIVE, "19954383398377106", true); + FieldValue.of(FieldValue.Attribute.PRIMITIVE, "19954383398377106", losslessOptions); long lossless = losslessFieldValue.getTimestampValue(); assertEquals(lossy, lossless); FieldValue fieldValue = - FieldValue.of(FieldValue.Attribute.PRIMITIVE, "19954383398377106", true); + FieldValue.of(FieldValue.Attribute.PRIMITIVE, "19954383398377106", losslessOptions); long received = fieldValue.getTimestampValue(); long expected = 19954383398377106L; assertEquals(expected, received); @@ -155,9 +157,11 @@ public void testInt64Timestamp() { public void testLosslessMaxTimestamp() { // Test the lossless behavior (useInt64Timestamps = true) // The backend returns a 64-bit integer string for microseconds when this option is enabled + DataFormatOptions losslessOptions = + DataFormatOptions.newBuilder().useInt64Timestamp(true).build(); String losslessTimestampString = "253402300799999999"; FieldValue losslessValue = - FieldValue.of(FieldValue.Attribute.PRIMITIVE, losslessTimestampString, true); + FieldValue.of(FieldValue.Attribute.PRIMITIVE, losslessTimestampString, losslessOptions); // Exactly matches the microsecond equivalent of 9999-12-31 23:59:59.999999 assertEquals(253402300799999999L, losslessValue.getTimestampValue()); diff --git a/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java b/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java index 4c3bf67921e6..4baf8f3af7ae 100644 --- a/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java +++ b/java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java @@ -47,6 +47,7 @@ import com.google.api.services.bigquery.model.TableReference; import com.google.cloud.NoCredentials; import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.DataFormatOptions; import com.google.cloud.bigquery.telemetry.BigQueryTelemetryTracer; import com.google.cloud.bigquery.telemetry.HttpTracingRequestInitializer; import io.opentelemetry.api.common.AttributeKey; @@ -1697,6 +1698,40 @@ public void testGetQueryResultsWithRowLimitNoTelemetry() throws Exception { verifyNoSpans(); } + @Test + public void testDataFormatOptionsPropagatedToListTableDataAndGetQueryResults() + throws Exception { + BigQueryOptions int64Options = + BigQueryOptions.newBuilder() + .setProjectId(PROJECT_ID) + .setCredentials(NoCredentials.getInstance()) + .setEnableOpenTelemetryTracing(false) + .setDataFormatOptions( + DataFormatOptions.newBuilder() + .useInt64Timestamp(true) + .timestampFormatOptions( + DataFormatOptions.TimestampFormatOptions.ISO8601_STRING) + .build()) + .setTransportOptions( + BigQueryOptions.getDefaultHttpTransportOptions().toBuilder() + .setHttpTransportFactory(() -> mockTransport) + .build()) + .build(); + HttpBigQueryRpc int64Rpc = new HttpBigQueryRpc(int64Options); + + setMockResponse("{\"kind\":\"bigquery#tableDataList\",\"rows\":[]}"); + int64Rpc.listTableDataSkipExceptionTranslation( + PROJECT_ID, DATASET_ID, TABLE_ID, new HashMap<>()); + verifyRequest("GET", "formatOptions.useInt64Timestamp=true"); + verifyRequest("GET", "formatOptions.timestampOutputFormat=ISO8601_STRING"); + + setMockResponse("{\"kind\":\"bigquery#getQueryResultsResponse\"}"); + int64Rpc.getQueryResultsSkipExceptionTranslation( + PROJECT_ID, JOB_ID, LOCATION, new HashMap<>()); + verifyRequest("GET", "formatOptions.useInt64Timestamp=true"); + verifyRequest("GET", "formatOptions.timestampOutputFormat=ISO8601_STRING"); + } + @Test public void testQueryRpcNoTelemetry() throws Exception { setMockResponse("{\"kind\":\"bigquery#queryResponse\"}"); From c322dbea4878f31d39779130eb90467681a5c215 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 14 Oct 2026 13:17:30 -0400 Subject: [PATCH 2/2] chore: Fix lint issues --- .../java/com/google/cloud/bigquery/BigQueryImpl.java | 6 ++---- .../main/java/com/google/cloud/bigquery/FieldValue.java | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index f16581d2d645..e9c70d8f8801 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -2207,8 +2207,7 @@ public TableDataList call() throws IOException { new PageImpl<>( new TableDataPageFetcher(tableId, schema, serviceOptions, cursor, pageOptionMap), cursor, - transformTableData( - result.getRows(), schema, serviceOptions.getDataFormatOptions())), + transformTableData(result.getRows(), schema, serviceOptions.getDataFormatOptions())), result.getTotalRows()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -2497,8 +2496,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() new PageImpl<>( new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), null, - transformTableData( - results.getRows(), schema, getOptions().getDataFormatOptions()))) + transformTableData(results.getRows(), schema, getOptions().getDataFormatOptions()))) // Return the JobID of the successful job .setJobId( results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null) diff --git a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index 1eec287eb72a..f0df1bcd28dd 100644 --- a/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -81,8 +81,7 @@ private FieldValue(Attribute attribute, Object value) { private FieldValue(Attribute attribute, Object value, DataFormatOptions dataFormatOptions) { this.attribute = checkNotNull(attribute); this.value = value; - this.useInt64Timestamps = - dataFormatOptions != null && dataFormatOptions.useInt64Timestamp(); + this.useInt64Timestamps = dataFormatOptions != null && dataFormatOptions.useInt64Timestamp(); } /** @@ -387,8 +386,7 @@ public static FieldValue of(Attribute attribute, Object value, Boolean useInt64T .build()); } - static FieldValue of( - Attribute attribute, Object value, DataFormatOptions dataFormatOptions) { + static FieldValue of(Attribute attribute, Object value, DataFormatOptions dataFormatOptions) { return new FieldValue(attribute, value, dataFormatOptions); } @@ -397,8 +395,7 @@ static FieldValue fromPb(Object cellPb) { } @SuppressWarnings("unchecked") - static FieldValue fromPb( - Object cellPb, Field recordSchema, DataFormatOptions dataFormatOptions) { + static FieldValue fromPb(Object cellPb, Field recordSchema, DataFormatOptions dataFormatOptions) { if (Data.isNull(cellPb)) { return FieldValue.of(Attribute.PRIMITIVE, null, dataFormatOptions); }