I'm trying to build an app that will update records in Big Query.
I'm using the number input button to get a replacement value.
If I use a whole number like 3, it will update. But if I enter a decimal I get an error:
'Value of type FLOAT64 cannot be assigned to field, which has type BIGNUMERIC'
How would I get this to work with decimals?
thanks!
Hey @James_76! Hmm interesting.
Would using CAST work for you? https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions
Something like:
UPDATE test.numericcol SET testcol = CAST(5.1 AS BIGNUMERIC) where id = 1;
Hi,
Thanks for the reply!
I was trying to use the GUI to do the update, and I could not find a way to apply a 'cast' to the data, or modify the type using .js
I eventually did as you suggest and wrote the SQL with a cast statement.
However, I am now trying to do a bulk insert from csv and have run into the same issue where the types don't align with Bignumeric...is there a way to manage that at GUI level?
We have a feature request to support passing decimal values to NUMERIC/BIGNUMERIC type columns in GUI mode!
In the meantime, your best bet is SQL mode. If transforming your data with JS works, then you can always use a JS transformer type query to do so before passing the data into your update query.