malloy icon indicating copy to clipboard operation
malloy copied to clipboard

BigQuery BIGNUMERIC type gives "invalid number" error

Open jswir opened this issue 2 months ago • 3 comments

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

jswir avatar Oct 28 '25 23:10 jswir

In VSCode, Preview doesn't work when a field is of this type is present

jswir avatar Oct 28 '25 23:10 jswir

claude suggested a simple fix, but I need to test

jswir avatar Oct 29 '25 15:10 jswir

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.

mtoy-googly-moogly avatar Nov 05 '25 03:11 mtoy-googly-moogly