Bjoern
Bjoern

Reputation: 445

What BigQuery data type do I use to support many decimal digits

We are importing data into BigQuery from a mainframe system, and some of the monetary values look like this: "54091.4369372923497267759562841530054645". If I cast it to NUMERIC, which is recommended for financial data, I only retain 9 decimal digits. If I cast it to FLOAT64, I get 12 decimal digits.

Is there any way for me to retain all the original information without losing precision?

I get that FLOAT64 is not recommended for financial calculations, but I would still expect to retain more decimals.

Upvotes: 0

Views: 883

Answers (1)

Felipe Hoffa
Felipe Hoffa

Reputation: 59225

Moving the comment to an answer for completeness:

  • The NUMERIC type in BigQuery won't be able to hold a number of this style.

  • In the meantime (to prevent data loss), just store these numbers as a STRING.

  • If this is an important feature for you, use the BigQuery public issue tracker - to enter and follow the request.

Upvotes: 1

Related Questions