Skip to content

Commit

Permalink
test(bigquery): regenerate snapshots from upstream sqlglot cross join…
Browse files Browse the repository at this point in the history
… fix
  • Loading branch information
cpcloud committed Jan 8, 2024
1 parent 30c769e commit 21191bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
SELECT
t0.`rowindex`,
IF(pos = pos_2, `repeated_struct_col`, NULL) AS `repeated_struct_col`
FROM array_test AS t0, UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t0.`repeated_struct_col`)) - 1)) AS pos
FROM array_test AS t0
CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t0.`repeated_struct_col`)) - 1)) AS pos
CROSS JOIN UNNEST(t0.`repeated_struct_col`) AS `repeated_struct_col` WITH OFFSET AS pos_2
WHERE
pos = pos_2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ FROM (
SELECT
t1.`rowindex`,
IF(pos = pos_2, `level_one`, NULL).`nested_struct_col` AS `level_one`
FROM array_test AS t1, UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t1.`repeated_struct_col`)) - 1)) AS pos
FROM array_test AS t1
CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t1.`repeated_struct_col`)) - 1)) AS pos
CROSS JOIN UNNEST(t1.`repeated_struct_col`) AS `level_one` WITH OFFSET AS pos_2
WHERE
pos = pos_2
Expand All @@ -16,7 +17,8 @@ FROM (
ARRAY_LENGTH(t1.`repeated_struct_col`) - 1
)
)
) AS t0, UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t0.`level_one`)) - 1)) AS pos
) AS t0
CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t0.`level_one`)) - 1)) AS pos
CROSS JOIN UNNEST(t0.`level_one`) AS `level_two` WITH OFFSET AS pos_2
WHERE
pos = pos_2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ WITH t0 AS (
SELECT
t7.`field_of_study`,
IF(pos = pos_2, `__pivoted__`, NULL) AS `__pivoted__`
FROM humanities AS t7, UNNEST(GENERATE_ARRAY(
FROM humanities AS t7
CROSS JOIN UNNEST(GENERATE_ARRAY(
0,
GREATEST(
ARRAY_LENGTH(
Expand Down Expand Up @@ -64,7 +65,8 @@ FROM (
SELECT
t7.`field_of_study`,
IF(pos = pos_2, `__pivoted__`, NULL) AS `__pivoted__`
FROM humanities AS t7, UNNEST(GENERATE_ARRAY(
FROM humanities AS t7
CROSS JOIN UNNEST(GENERATE_ARRAY(
0,
GREATEST(
ARRAY_LENGTH(
Expand Down

0 comments on commit 21191bf

Please sign in to comment.