lostluck commented on a change in pull request #12061:
URL: https://github.com/apache/beam/pull/12061#discussion_r444345197



##########
File path: sdks/go/pkg/beam/io/bigqueryio/bigquery.go
##########
@@ -90,21 +90,27 @@ func Read(s beam.Scope, project, table string, t 
reflect.Type) beam.PCollection
 
        // TODO(herohde) 7/13/2017: using * is probably too inefficient. We 
could infer
        // a focused query from the type.
-       return query(s, project, fmt.Sprintf("SELECT * from [%v]", table), t)
+       return query(s, project, fmt.Sprintf("SELECT * from [%v]", table), t, 
nil)
+}
+
+// QueryOptions represents additional options for executing a query.
+type QueryOptions struct {

Review comment:
       I'm less familiar with Big Query and it's option set, but consider 
switching this to a variadic list of functional options ala 
https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis  In 
particular, this avoids a breaking compile change when the (admitedly few) 
users of this function update their beam.
   
   It doesn't remove the need for a QueryOptions struct to serialize the 
options, but it does allow the callsite to not have empty options every time.
   
   I don't feel super strongly about this as it's likely this package will 
likely need updating when we fix module versioning, but it's a suggestion worth 
discussing.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to