-
Notifications
You must be signed in to change notification settings - Fork 1.7k
bigquery.ArrayQueryParameter should be able to accept structs as elements of the array #2906
Copy link
Copy link
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
I commented that setting the types on array query parameters needs to be recursive since the array could contain structs. Note that arrays cannot contain arrays (the workaround is to contain a struct which can then contain an array).
It's not clear how one would do this with the current
ArrayQueryParameterconstructor.Maybe we need to change how array query parameters are constructed? Maybe it should look more like the StructQueryParameter constructor?
It'd be a pain for scalar values and the names would have to be ignored on the
sub_paramsif provided, but it's more flexible.An aside
I'd actually love if we could get rid of all the
XQueryParameterclasses and use lists, dicts, and ints, floats, etc. But I see that it might be ambiguous for some types especiallyDATETIME(no time zone) vsTIMESTAMP(stored as UTC time).