Suppose i have a bigquery table "table1" containing a column "field1" and a table "table2" containing an array column "field2"
I want to join each line of table1 to each line of table2 for which the value of "field1" appears in the array "field2"
I tried the query below but it seems to take too much time in Bigquery, it never ended actually for the cases i tested, so i think there is something wrong about it
Is there a better way to achieve this ?
Tested query :
SELECT *
FROM table1
LEFT JOIN table2 ON table1.field1 IN UNNEST(table2.field2)
Result :
Operation timed out after 6.0 hours. Consider reducing the amount of work performed by your operation so that it can complete within this limit.
It could be that the rows of the joined table are much more than expected. It could be that table2 is much larger than table1 and therefore a right join could be more efficent. First we obtain the final row size of the joined table.
y in (...)several machings tofield1are in the arrayfield2.struct.countssome information can be obtained, such as the final row size of the joined table. Is this one feasible?