Does mode support UDF with bigquery?
I have a query works well in bigquery, but mode is throwing error:
Syntax error: Unclosed triple-quoted string literal
here is the query. Am I missing anything?
#standardSQL CREATE TEMP FUNCTION JsonArray(input STRING) RETURNS ARRAY<STRING> LANGUAGE js AS """ return JSON.parse(input); """; SELECT JsonArray('["x","y","z"]')
Hi Stone Zhong and Andreas Rolén , we had recently fixed this issue. Before, if there's code block that contains a semi-colon, it will automatically split the query and break SQL parsing. Now, if you don't want Mode processing to split a sequence of commands on a semi-colon, you place it inside angle brackets like this: <;>. This sequence tells Mode processing to change <;> to ; wherever it occurs and then send the entire command string to the DB on the backend (whatever type that is). For example:
CREATE TEMP FUNCTION multiplyInputs(x FLOAT64, y FLOAT64) RETURNS FLOAT64 LANGUAGE js AS """ return x*y<;> """<;>Reply