diff --git a/udfs/community/typeof.sqlx b/udfs/community/typeof.sqlx index 63baa67f9..5e1698d5c 100644 --- a/udfs/community/typeof.sqlx +++ b/udfs/community/typeof.sqlx @@ -23,7 +23,7 @@ AS ( ( SELECT CASE -- Process NUMERIC, DATE, DATETIME, TIME, TIMESTAMP, - WHEN REGEXP_CONTAINS(literal, r'^[A-Z]+ "') THEN REGEXP_EXTRACT(literal, r'^([A-Z]+) "') + WHEN REGEXP_CONTAINS(literal, r'^[A-Z]+ ("|\')') THEN REGEXP_EXTRACT(literal, r'^([A-Z]+) (?:"|\')') WHEN REGEXP_CONTAINS(literal, r'^-?[0-9]*$') THEN 'INT64' WHEN REGEXP_CONTAINS(literal, r'^(-?[0-9]+[.e].*|CAST\("([^"]*)" AS FLOAT64\))$') THEN 'FLOAT64' WHEN literal IN ('true', 'false') THEN 'BOOL'