TheNeuralBit commented on a change in pull request #14586:
URL: https://github.com/apache/beam/pull/14586#discussion_r661816697
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java
##########
@@ -591,6 +591,7 @@ public static Read read() {
.setParseFn(parseFn)
.setMethod(Method.DEFAULT)
.setUseAvroLogicalTypes(false)
+ .setFormat(DataFormat.DATA_FORMAT_UNSPECIFIED)
Review comment:
```suggestion
.setFormat(DataFormat.AVRO)
```
The default should be specified here, instead of relying on execution time
code.
##########
File path:
examples/java/src/main/java/org/apache/beam/examples/cookbook/BigQueryTornadoes.java
##########
@@ -179,14 +180,16 @@ static void runBigQueryTornadoes(Options options) {
BigQueryIO.readTableRows()
.fromQuery(options.getInputQuery())
.usingStandardSql()
- .withMethod(Method.DIRECT_READ));
+ .withMethod(Method.DIRECT_READ)
+ .withFormat(DataFormat.AVRO));
} else {
rowsFromBigQuery =
p.apply(
BigQueryIO.readTableRows()
.from(options.getInput())
.withMethod(Method.DIRECT_READ)
- .withSelectedFields(Lists.newArrayList("month",
"tornado")));
+ .withSelectedFields(Lists.newArrayList("month",
"tornado"))
+ .withFormat(DataFormat.AVRO));
Review comment:
Ah, sorry, I didn't realize that
https://github.com/apache/beam/pull/14586#discussion_r659087861 was the only
place where you were handling the default, normally we specify defaults in the
IO creator methods (see comment above).
Please remove the `.withFormat(DataFormat.AVRO)`.
--
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]