0

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!

2 Answers2

1

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

vanathi-g
  • 36
  • 1
0

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.

Poala Astrid
  • 1,028
  • 2
  • 10
  • This doesn't answer the question. I need to convert it to numeric BEFORE it's written to BigQuery, not after it has been written. – Ricardo Tejada Jun 14 '23 at 17:30