Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Big-query does now cast automatically long decimal values to numeric, when running a load job from UI

I have a value "1.8299324324324324" which if I insert using DML statement to BigQuery, it rounds it off and inserts in Bigquery.

However, for the same value, if BigQuery load job using csv file on console, I get below error.

"location" : "query", "message" : "Invalid NUMERIC value: 1.8299324324324324 Field: test; Value: 1.8299324324324324", "reason" : "invalidQuery"

Just wanted to check if this is a limitation of Bigquery, that in load job it is not able to cast or understand this value and how to solve it?

like image 317
Pankaj Bajpai Avatar asked Dec 23 '22 23:12

Pankaj Bajpai


1 Answers

According to the documentation, BigQuery's NUMERIC type has a limit of 9 decimal digits:

Decimal values with 38 decimal digits of precision and 9 decimal digits of scale.

As an alternative, using the (less precise) FLOAT64 type should bypass this problem.

like image 118
Alix Axel Avatar answered Dec 28 '22 06:12

Alix Axel