Skip to content

Commit e45ab70

Browse files
authored
fix conversion failures - block was at the wrong nesting level (#38336)
1 parent 4678606 commit e45ab70

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,9 +1639,9 @@ public static ByteString mergeNewFields(
16391639
null,
16401640
null,
16411641
collectedExceptions);
1642-
if (!collectedExceptions.isEmpty()) {
1643-
return null;
1644-
}
1642+
}
1643+
if (!collectedExceptions.isEmpty()) {
1644+
return null;
16451645
}
16461646
} else if (schemaInformation.getType() == TableFieldSchema.Type.TIMESTAMP
16471647
&& schemaInformation.getTimestampPrecision() == PICOSECOND_PRECISION) {

sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiDataTriggeredSchemaUpdateIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.Write.CreateDisposition;
3737
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.Write.WriteDisposition;
3838
import org.apache.beam.sdk.io.gcp.testing.BigqueryClient;
39+
import org.apache.beam.sdk.options.StreamingOptions;
3940
import org.apache.beam.sdk.state.StateSpec;
4041
import org.apache.beam.sdk.state.StateSpecs;
4142
import org.apache.beam.sdk.state.ValueState;
@@ -187,6 +188,7 @@ public void testDataTriggeredSchemaUpgradeAtLeastOnce() throws Exception {
187188
private void runTest(Write.Method method) throws Exception {
188189
Pipeline p = Pipeline.create(TestPipeline.testingPipelineOptions());
189190
p.getOptions().as(BigQueryOptions.class).setSchemaUpgradeBufferingShards(1);
191+
p.getOptions().as(StreamingOptions.class).setStreaming(true);
190192

191193
TableSchema baseSchema =
192194
new TableSchema()

0 commit comments

Comments
 (0)