unytics/bigfunctions

[bug]: `faker`: Many functions (random_int, boolean...) does not work in BigQuery

florian-guily opened this issue · 1 comments

Check the bug has not already been reported

Edit function_name and the short error description in title above

  • I wrote the correct function name and a short error description in the title above

What happened and what did you expect?

Many faker functions does not work natively in BigQuery. Seems like every functions that outputs a different type than STRING breaks when used in select statement in BigQuery such as:
SELECT bigfunctions.eu.faker("boolean", Null) raising the following error Failed to decode JSON value true in replies to SQL type STRING.

You can also try with random_int or unix_time. Maybe i'm using it wrong but nothing indicates how to use it differently.

Thanks for opening this issue @florian-guily.
Great one.

I fixed it by converting the output to string before returning it.

(Better would be to return a boolean but unfortunately remote function can return only one type).

It is deployed.

image