Bigquery - Split Output is Repeated String and therefore ARRAY

When you use SPLIT function in BigQuery, the result is an ARRAY

You need to UNNEST the result of split as shown below to use it:

\n\n
WITH \nex1 AS (\nSELECT 'test1,test2' as example),\n\nex2 AS (\nSELECT 'test1' as str1, 5 as value)\n\nSELECT * from\n(SELECT * FROM UNNEST((SELECT split(example) FROM ex1)) as strings)\nleft join ex2\non str1 = strings\n

dan-irving

posted on

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds