holyshilo111
holyshilo111

Reputation: 133

Cloud Data Fusion: Numeric datatype into BigQuery

I'm running a Data Fusion pipeline with Wrangler transformations and I want to store a value as Numeric in BigQuery for some precise arithmetic calculations, but Wrangler doesn't let me transform a FLOAT value to NUMERIC.

I've tried with implicit conversion trying to write a FLOAT value into a NUMERIC column inside BQ but that didn't work.

Is there a workaround for this?

Thanks!

Upvotes: 0

Views: 307

Answers (2)

Poala Astrid
Poala Astrid

Reputation: 842

You can use CAST() function for explicit conversion as it always converts any numeric type to another numeric type.

CAST(expression AS NUMERIC)

You can refer to this documentation for conversion rules and comparison chart.

Upvotes: 0

vanathi-g
vanathi-g

Reputation: 36

You can convert the value to a decimal datatype which maps to the bigquery NUMERIC datatype. Documentation here.

Upvotes: 1

Related Questions