[
https://issues.apache.org/jira/browse/BEAM-4634?focusedWorklogId=450060&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-450060
]
ASF GitHub Bot logged work on BEAM-4634:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jun/20 22:46
Start Date: 23/Jun/20 22:46
Worklog Time Spent: 10m
Work Description: lostluck commented on a change in pull request #12061:
URL: https://github.com/apache/beam/pull/12061#discussion_r444548615
##########
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:
Part of the functional options is to have the user level functions
return functions. This allows for closures over user configuration for more
complicated options later on. Probably doesn't matter in this case, but
otherwise:
eg.
```suggestion
func UseStandardSQL() func(qo *QueryOptions) error {
return func(qo *QueryOptions) error
qo.UseStandardSQL = true
return nil
}
}
```
I'd probably drop the "use" so it's just StandardSQL. When there are more
of these, the repeated Use prefix will get tiresome and reduce readability.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 450060)
Time Spent: 50m (was: 40m)
> Use Standard SQL in biqueryio transform
> ---------------------------------------
>
> Key: BEAM-4634
> URL: https://issues.apache.org/jira/browse/BEAM-4634
> Project: Beam
> Issue Type: Improvement
> Components: sdk-go
> Reporter: Eduardo Morales
> Priority: P3
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The bigqueryio transform is currently hard coded to use Legacy SQL. Using the
> newer Standard SQL would allow us to write richer queries.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)