[
https://issues.apache.org/jira/browse/BEAM-4363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17546950#comment-17546950
]
Kenneth Knowles commented on BEAM-4363:
---------------------------------------
This issue has been migrated to https://github.com/apache/beam/issues/18761
> Method chaining order matters for BigQueryIO.readTableRows() and
> usingStandardSql()
> -----------------------------------------------------------------------------------
>
> Key: BEAM-4363
> URL: https://issues.apache.org/jira/browse/BEAM-4363
> Project: Beam
> Issue Type: Bug
> Components: io-java-gcp
> Affects Versions: 2.4.0
> Reporter: Peter Brumblay
> Priority: P3
>
> Depending on the order of the method calls you use in the fluent API for
> BigQueryIO.readTableRows() you'll either successfully execute a query
> requiring standard SQL or get an error indicating that you tried something
> incompatible with legacy SQL.
> Works:
> {code:java}
> p.apply("Read rows will succeed",
> BigQueryIO.readTableRows().fromQuery(query.toString()).usingStandardSql());
> {code}
> Fails with a 400:
> {code:java}
> p.apply("Read rows will fail",
> BigQueryIO.readTableRows().usingStandardSql().fromQuery(query.toString()));
> {code}
> Error message (edited to anonymize):
> "Invalid table name: `<project>:<dataset>.<table>`\n[Try using standard SQL
> ([https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)].]
>
> I wouldn't expect a fluent API to care about the ordering of the clauses.
> Even if a specific order were required, I would expect a more informative
> error message with a link to a grammar ...
>
> See here for a complete example:
> https://github.com/pbrumblay/bigqueryioproblems/blob/master/src/main/java/com/fearlesstg/UsingStandardSQLOrderMatters.java
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)