Skip to content Skip to sidebar Skip to footer

Flatten Multiple Arrays With Uneven Lengths In Bigquery

I'm trying to flatten arrays in different columns with different lengths without duplicating the results. For example (using standard SQL): WITH x AS ( SELECT ARRAY[1,

Solution 1:

You can use JOIN:

SELECT a, b
FROM x LEFT JOIN
     UNNEST(x.a) a left join
     unnest(x.b) b 
     ON a = b;

Post a Comment for "Flatten Multiple Arrays With Uneven Lengths In Bigquery"