1
0
Fork 0

Merging upstream version 26.22.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-29 07:21:12 +02:00
parent ecad2ca6a9
commit 3552a78d82
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
69 changed files with 29194 additions and 28548 deletions

View file

@ -28,6 +28,21 @@ TIME;
TIME_SUB(CAST('09:05:03' AS TIME), INTERVAL 2 HOUR);
TIME;
SORT_ARRAY(ARRAY(tbl.str_col));
ARRAY<STRING>;
SORT_ARRAY(ARRAY(tbl.double_col));
ARRAY<DOUBLE>;
SORT_ARRAY(ARRAY(tbl.bigint_col));
ARRAY<BIGINT>;
tbl.bigint || tbl.str_col;
VARCHAR;
tbl.str_col || tbl.bigint;
VARCHAR;
--------------------------------------
-- Spark2 / Spark3 / Databricks
--------------------------------------

View file

@ -86,3 +86,9 @@ TIME;
# dialect: bigquery
EXTRACT(day from x);
INT;
CASE WHEN x THEN CAST(y AS DECIMAL(18, 2)) ELSE NULL END;
DECIMAL(18,2);
CASE WHEN x THEN NULL ELSE CAST(y AS DECIMAL(18, 2)) END;
DECIMAL(18,2);

View file

@ -693,14 +693,14 @@ PIVOT(MAX("SOURCE"."VALUE") FOR "SOURCE"."KEY" IN ('a', 'b', 'c')) AS "FINAL"("I
# dialect: snowflake
SELECT * FROM m_sales AS m_sales(empid, dept, jan, feb) UNPIVOT(sales FOR month IN (jan, feb)) ORDER BY empid;
SELECT
"_Q_0"."EMPID" AS "EMPID",
"_Q_0"."DEPT" AS "DEPT",
"_Q_0"."MONTH" AS "MONTH",
"_Q_0"."SALES" AS "SALES"
"M_SALES"."EMPID" AS "EMPID",
"M_SALES"."DEPT" AS "DEPT",
"M_SALES"."MONTH" AS "MONTH",
"M_SALES"."SALES" AS "SALES"
FROM "M_SALES" AS "M_SALES"("EMPID", "DEPT", "JAN", "FEB")
UNPIVOT("SALES" FOR "MONTH" IN ("JAN", "FEB")) AS "_Q_0"
UNPIVOT("SALES" FOR "MONTH" IN ("JAN", "FEB")) AS "M_SALES"
ORDER BY
"_Q_0"."EMPID";
"M_SALES"."EMPID";
# title: unpivoted table source, unpivot has column aliases
# execute: false
@ -747,28 +747,28 @@ ORDER BY
# note: the named columns aren not supported by BQ but we add them here to avoid defining a schema
SELECT * FROM produce AS produce(product, q1, q2, q3, q4) UNPIVOT(sales FOR quarter IN (q1, q2, q3, q4));
SELECT
`_q_0`.`product` AS `product`,
`_q_0`.`quarter` AS `quarter`,
`_q_0`.`sales` AS `sales`
`produce`.`product` AS `product`,
`produce`.`quarter` AS `quarter`,
`produce`.`sales` AS `sales`
FROM `produce` AS `produce`
UNPIVOT(`sales` FOR `quarter` IN (`produce`.`q1`, `produce`.`q2`, `produce`.`q3`, `produce`.`q4`)) AS `_q_0`;
UNPIVOT(`sales` FOR `quarter` IN (`produce`.`q1`, `produce`.`q2`, `produce`.`q3`, `produce`.`q4`)) AS `produce`;
# title: unpivoted table source with multiple value columns
# execute: false
# dialect: bigquery
SELECT * FROM produce AS produce(product, q1, q2, q3, q4) UNPIVOT((first_half_sales, second_half_sales) FOR semesters IN ((Q1, Q2) AS 'semester_1', (Q3, Q4) AS 'semester_2'));
SELECT
`_q_0`.`product` AS `product`,
`_q_0`.`semesters` AS `semesters`,
`_q_0`.`first_half_sales` AS `first_half_sales`,
`_q_0`.`second_half_sales` AS `second_half_sales`
`produce`.`product` AS `product`,
`produce`.`semesters` AS `semesters`,
`produce`.`first_half_sales` AS `first_half_sales`,
`produce`.`second_half_sales` AS `second_half_sales`
FROM `produce` AS `produce`
UNPIVOT((`first_half_sales`, `second_half_sales`) FOR
`semesters` IN (
(`produce`.`q1`, `produce`.`q2`) AS 'semester_1',
(`produce`.`q3`, `produce`.`q4`) AS 'semester_2'
)
) AS `_q_0`;
) AS `produce`;
# title: quoting is preserved
# dialect: snowflake

View file

@ -11105,11 +11105,9 @@ LEFT JOIN "ws" AS "ws"
AND "ss"."ss_item_sk" = "ws"."ws_item_sk"
AND "ss"."ss_sold_year" = "ws"."ws_sold_year"
WHERE
"cs"."cs_qty" > 0
AND "ss"."ss_sold_year" = 1999
AND "ws"."ws_qty" > 0
AND NOT "cs"."cs_qty" IS NULL
AND NOT "ws"."ws_qty" IS NULL
"ss"."ss_sold_year" = 1999
AND COALESCE("cs"."cs_qty", 0) > 0
AND COALESCE("ws"."ws_qty", 0) > 0
ORDER BY
"ss_item_sk",
"ss"."ss_qty" DESC,