You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
feat: add DECIMAL and BIGDECIMAL as aliases for NUMERIC and BIGNUMERIC to scalar types enums #633
On second-thought, these are actually called NUMERIC and BIGNUMERIC in BigQuery. I don't know if we want to be adding aliases outside of those we already have for Legacy SQL support.
changed the title [-]feat: add DECIMAL and BIGDECIMAL to scalar types enums[/-][+]feat: add DECIMAL and BIGDECIMAL as aliases for NUMERIC and BIGNUMERIC to scalar types enums[/+]on Apr 28, 2021
I'd like to use those in code samples where folks have STRUCT type query parameters with sub-fields
Honestly, it'd be much more useful if we supplemented the class to allow a builder-style construction where we add a with_name(...) function that makes a copy of the parameter type but adds a name.
I'd like to use those in code samples where folks have STRUCT type query parameters with sub-fields
I'm thinking that there's a lot to unpack there. :)
"those" meaning decimal types? Or the enums?
"code samples" do you mean code in the samples/ directory? (I haven't ventured there yet.)
"STRUCT type query parameters with sub-fields" My head just exploded a little. :) I guess this is going to be something like:
"select %(foo:STRUCT<INT64,STRING>)s"
Honestly, it'd be much more useful if we supplemented the class to allow a builder-style construction where we add a with_name(...) function that makes a copy of the parameter type but adds a name.
I mean the ScalarQueryParameter type. I've filed #642 we can continue the discussion of the feature there.
"code samples"
Yes, I mean the samples/ directory. Usually we aim to publish those samples on cloud.google.com/bigquery/docs as well.
"STRUCT type query parameters with sub-fields" My head just exploded a little. :) I guess this is going to be something like: "select %(foo:STRUCT<INT64,STRING>)s"
Activity
tswast commentedon Apr 28, 2021
On second-thought, these are actually called
NUMERICandBIGNUMERICin BigQuery. I don't know if we want to be adding aliases outside of those we already have for Legacy SQL support.🤔
[-]feat: add DECIMAL and BIGDECIMAL to scalar types enums[/-][+]feat: add DECIMAL and BIGDECIMAL as aliases for NUMERIC and BIGNUMERIC to scalar types enums[/+]jimfulton commentedon Apr 28, 2021
But these are defined as valid standard sql aliases here: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types
jimfulton commentedon Apr 28, 2021
IMO, this is a bug not a feature. :)
jimfulton commentedon Apr 28, 2021
@tswast shall I address this?
tswast commentedon Apr 28, 2021
Gotcha. I didn't realize the backend had these as aliases. Yes, let's go for it.
jimfulton commentedon Apr 28, 2021
I can't find any use of
SqlParameterScalarTypes.I searched:
googleandtestsource directories.Is there a reason we think we need this (other than for our internal use)?
tswast commentedon Apr 30, 2021
I'd like to use those in code samples where folks have STRUCT type query parameters with sub-fields
Honestly, it'd be much more useful if we supplemented the class to allow a builder-style construction where we add a
with_name(...)function that makes a copy of the parameter type but adds a name.tswast commentedon Apr 30, 2021
Closed by #638
jimfulton commentedon Apr 30, 2021
I'm thinking that there's a lot to unpack there. :)
samples/directory? (I haven't ventured there yet.)"select %(foo:STRUCT<INT64,STRING>)s"
I'm lost. which class?
Can you expand a little?
tswast commentedon Apr 30, 2021
I mean the ScalarQueryParameter type. I've filed #642 we can continue the discussion of the feature there.
Yes, I mean the
samples/directory. Usually we aim to publish those samples on cloud.google.com/bigquery/docs as well.That's right! See: #463
In addition to what you've written with anonymous sub-fields, it's also possible to give those names.