BigQuery BIGNUMERIC type gives "invalid number" error
What happens?
when reading a type BIGNUMERIC in bigquery, malloy returns "invalid number"
I have 2 workarounds:
- cast to string, then cast to number
- use sql_number to cast to float64 in sql
But ideal behavior would be that this is supported directly
To Reproduce
Create a bignumeric field in bigquery and query it with malloy
OS:
macOS
Malloy Client:
VSCode w/Publisher
Malloy Client Version:
v0.3.1761585569
Database Connection:
BigQuery
In VSCode, Preview doesn't work when a field is of this type is present
claude suggested a simple fix, but I need to test
yeah we need to think through bignum, pretty sure i am not going to like claude's analysis.
we also have #2490 hanging out there and there is some hard thinking about what right solution is. it's on my list to get to for sure.
what happens is a bignumber columns appears to malloy as an unsupported" type which is not a number.
(see https://docs.malloydata.dev/documentation/language/datatypes#unsupported-sql-native-data )
casting a bignumber value with
mybigNum::number
should let you use it as a a number, though you will lose precision.