bamnet commented on a change in pull request #12061:
URL: https://github.com/apache/beam/pull/12061#discussion_r444565916
##########
File path: sdks/go/pkg/beam/io/bigqueryio/bigquery.go
##########
@@ -93,18 +93,37 @@ func Read(s beam.Scope, project, table string, t
reflect.Type) beam.PCollection
return query(s, project, fmt.Sprintf("SELECT * from [%v]", table), t)
}
+// QueryOptions represents additional options for executing a query.
+type QueryOptions struct {
+ // UseStandardSQL enables BigQuery's Standard SQL dialect when
executing a query.
+ UseStandardSQL bool
+}
+
+// UseStandardSQL enables BigQuery's Standard SQL dialect when executing a
query.
+func UseStandardSQL(qo *QueryOptions) error {
+ qo.UseStandardSQL = true
+ return nil
+}
Review comment:
Done. Swapped to returning a function.
I left the `Use` prefix to match the the Python and Java BigQuery IO
packages and base BQ library. Other config options, like flatten results and
validation, don't follow this pattern so I expect this to be a one-off (feels
like legacy decision from the BigQuery API design). Happy to change tho, LMK!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]