pabloem commented on a change in pull request #16303:
URL: https://github.com/apache/beam/pull/16303#discussion_r792949483
##########
File path:
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BigQuerySchemaUpdateOptionsIT.java
##########
@@ -219,4 +219,64 @@ public void testAllowFieldRelaxation() throws Exception {
List<List<String>> expectedResult = Arrays.asList(Arrays.asList(value));
runWriteTest(schemaUpdateOptions, tableName, newSchema, rowToInsert,
testQuery, expectedResult);
}
+
+ @Test
+ public void runWriteTestTempTables() throws Exception {
+ String tableName = makeTestTable();
+
+ Set<SchemaUpdateOption> schemaUpdateOptions =
+ EnumSet.of(BigQueryIO.Write.SchemaUpdateOption.ALLOW_FIELD_ADDITION);
+
+ TableSchema schema =
+ new TableSchema()
+ .setFields(
+ ImmutableList.of(
+ new
TableFieldSchema().setName("new_field").setType("STRING"),
+ new
TableFieldSchema().setName("optional_field").setType("STRING"),
+ new TableFieldSchema()
+ .setName("required_field")
+ .setType("STRING")
+ .setMode("REQUIRED")));
+
+ String[] values = {"meow", "bark"};
+ TableRow rowToInsert =
+ new TableRow().set("new_field", values[0]).set("required_field",
values[1]);
Review comment:
is a single row enough to cause two loads to happen? Can we please add
another Row so that we can force a two-stage load?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]