-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sql 207/208] chore(snowflake): regen tpch sql
- Loading branch information
Showing
20 changed files
with
1,604 additions
and
1,570 deletions.
There are no files selected for viewing
85 changes: 44 additions & 41 deletions
85
ibis/backends/tests/tpch/snapshots/test_h01/test_tpc_h01/snowflake/h01.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,62 @@ | ||
SELECT | ||
* | ||
"t2"."l_returnflag" AS "l_returnflag", | ||
"t2"."l_linestatus" AS "l_linestatus", | ||
"t2"."sum_qty" AS "sum_qty", | ||
"t2"."sum_base_price" AS "sum_base_price", | ||
"t2"."sum_disc_price" AS "sum_disc_price", | ||
"t2"."sum_charge" AS "sum_charge", | ||
"t2"."avg_qty" AS "avg_qty", | ||
"t2"."avg_price" AS "avg_price", | ||
"t2"."avg_disc" AS "avg_disc", | ||
"t2"."count_order" AS "count_order" | ||
FROM ( | ||
SELECT | ||
"t2"."l_returnflag" AS "l_returnflag", | ||
"t2"."l_linestatus" AS "l_linestatus", | ||
SUM("t2"."l_quantity") AS "sum_qty", | ||
SUM("t2"."l_extendedprice") AS "sum_base_price", | ||
SUM("t2"."l_extendedprice" * ( | ||
1 - "t2"."l_discount" | ||
"t1"."l_returnflag" AS "l_returnflag", | ||
"t1"."l_linestatus" AS "l_linestatus", | ||
SUM("t1"."l_quantity") AS "sum_qty", | ||
SUM("t1"."l_extendedprice") AS "sum_base_price", | ||
SUM("t1"."l_extendedprice" * ( | ||
1 - "t1"."l_discount" | ||
)) AS "sum_disc_price", | ||
SUM( | ||
( | ||
"t2"."l_extendedprice" * ( | ||
1 - "t2"."l_discount" | ||
"t1"."l_extendedprice" * ( | ||
1 - "t1"."l_discount" | ||
) | ||
) * ( | ||
"t2"."l_tax" + 1 | ||
"t1"."l_tax" + 1 | ||
) | ||
) AS "sum_charge", | ||
AVG("t2"."l_quantity") AS "avg_qty", | ||
AVG("t2"."l_extendedprice") AS "avg_price", | ||
AVG("t2"."l_discount") AS "avg_disc", | ||
AVG("t1"."l_quantity") AS "avg_qty", | ||
AVG("t1"."l_extendedprice") AS "avg_price", | ||
AVG("t1"."l_discount") AS "avg_disc", | ||
COUNT(*) AS "count_order" | ||
FROM ( | ||
SELECT | ||
* | ||
FROM ( | ||
SELECT | ||
"t0"."L_ORDERKEY" AS "l_orderkey", | ||
"t0"."L_PARTKEY" AS "l_partkey", | ||
"t0"."L_SUPPKEY" AS "l_suppkey", | ||
"t0"."L_LINENUMBER" AS "l_linenumber", | ||
"t0"."L_QUANTITY" AS "l_quantity", | ||
"t0"."L_EXTENDEDPRICE" AS "l_extendedprice", | ||
"t0"."L_DISCOUNT" AS "l_discount", | ||
"t0"."L_TAX" AS "l_tax", | ||
"t0"."L_RETURNFLAG" AS "l_returnflag", | ||
"t0"."L_LINESTATUS" AS "l_linestatus", | ||
"t0"."L_SHIPDATE" AS "l_shipdate", | ||
"t0"."L_COMMITDATE" AS "l_commitdate", | ||
"t0"."L_RECEIPTDATE" AS "l_receiptdate", | ||
"t0"."L_SHIPINSTRUCT" AS "l_shipinstruct", | ||
"t0"."L_SHIPMODE" AS "l_shipmode", | ||
"t0"."L_COMMENT" AS "l_comment" | ||
FROM "LINEITEM" AS "t0" | ||
) AS "t1" | ||
"t0"."L_ORDERKEY" AS "l_orderkey", | ||
"t0"."L_PARTKEY" AS "l_partkey", | ||
"t0"."L_SUPPKEY" AS "l_suppkey", | ||
"t0"."L_LINENUMBER" AS "l_linenumber", | ||
"t0"."L_QUANTITY" AS "l_quantity", | ||
"t0"."L_EXTENDEDPRICE" AS "l_extendedprice", | ||
"t0"."L_DISCOUNT" AS "l_discount", | ||
"t0"."L_TAX" AS "l_tax", | ||
"t0"."L_RETURNFLAG" AS "l_returnflag", | ||
"t0"."L_LINESTATUS" AS "l_linestatus", | ||
"t0"."L_SHIPDATE" AS "l_shipdate", | ||
"t0"."L_COMMITDATE" AS "l_commitdate", | ||
"t0"."L_RECEIPTDATE" AS "l_receiptdate", | ||
"t0"."L_SHIPINSTRUCT" AS "l_shipinstruct", | ||
"t0"."L_SHIPMODE" AS "l_shipmode", | ||
"t0"."L_COMMENT" AS "l_comment" | ||
FROM "LINEITEM" AS "t0" | ||
WHERE | ||
( | ||
"t1"."l_shipdate" <= DATEFROMPARTS(1998, 9, 2) | ||
) | ||
) AS "t2" | ||
"t0"."L_SHIPDATE" <= DATEFROMPARTS(1998, 9, 2) | ||
) AS "t1" | ||
GROUP BY | ||
1, | ||
2 | ||
) AS "t3" | ||
) AS "t2" | ||
ORDER BY | ||
"t3"."l_returnflag" ASC, | ||
"t3"."l_linestatus" ASC | ||
"t2"."l_returnflag" ASC, | ||
"t2"."l_linestatus" ASC |
Oops, something went wrong.