Skip to content

Commit

Permalink
chore(snowlake): update sql snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
kszucs committed Apr 25, 2024
1 parent d7a31aa commit 804d4b5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ WITH "t9" AS (
FROM "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1"."NATION" AS "t4"
)
SELECT
"t20"."supp_nation",
"t20"."cust_nation",
"t20"."l_year",
"t20"."revenue"
"t19"."supp_nation",
"t19"."cust_nation",
"t19"."l_year",
"t19"."revenue"
FROM (
SELECT
"t19"."supp_nation",
"t19"."cust_nation",
"t19"."l_year",
SUM("t19"."volume") AS "revenue"
"t18"."supp_nation",
"t18"."cust_nation",
"t18"."l_year",
SUM("t18"."volume") AS "revenue"
FROM (
SELECT
"t18"."supp_nation",
"t18"."cust_nation",
"t18"."l_shipdate",
"t18"."l_extendedprice",
"t18"."l_discount",
"t18"."l_year",
"t18"."volume"
"t17"."supp_nation",
"t17"."cust_nation",
"t17"."l_shipdate",
"t17"."l_extendedprice",
"t17"."l_discount",
"t17"."l_year",
"t17"."volume"
FROM (
SELECT
"t15"."n_name" AS "supp_nation",
"t17"."n_name" AS "cust_nation",
"t16"."n_name" AS "cust_nation",
"t11"."l_shipdate",
"t11"."l_extendedprice",
"t11"."l_discount",
Expand Down Expand Up @@ -98,34 +98,34 @@ FROM (
ON "t13"."c_custkey" = "t12"."o_custkey"
INNER JOIN "t9" AS "t15"
ON "t10"."s_nationkey" = "t15"."n_nationkey"
INNER JOIN "t9" AS "t17"
ON "t13"."c_nationkey" = "t17"."n_nationkey"
) AS "t18"
INNER JOIN "t9" AS "t16"
ON "t13"."c_nationkey" = "t16"."n_nationkey"
) AS "t17"
WHERE
(
(
(
"t18"."cust_nation" = 'FRANCE'
"t17"."cust_nation" = 'FRANCE'
) AND (
"t18"."supp_nation" = 'GERMANY'
"t17"."supp_nation" = 'GERMANY'
)
)
OR (
(
"t18"."cust_nation" = 'GERMANY'
"t17"."cust_nation" = 'GERMANY'
) AND (
"t18"."supp_nation" = 'FRANCE'
"t17"."supp_nation" = 'FRANCE'
)
)
)
AND "t18"."l_shipdate" BETWEEN DATE_FROM_PARTS(1995, 1, 1) AND DATE_FROM_PARTS(1996, 12, 31)
) AS "t19"
AND "t17"."l_shipdate" BETWEEN DATE_FROM_PARTS(1995, 1, 1) AND DATE_FROM_PARTS(1996, 12, 31)
) AS "t18"
GROUP BY
1,
2,
3
) AS "t20"
) AS "t19"
ORDER BY
"t20"."supp_nation" ASC,
"t20"."cust_nation" ASC,
"t20"."l_year" ASC
"t19"."supp_nation" ASC,
"t19"."cust_nation" ASC,
"t19"."l_year" ASC
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ WITH "t13" AS (
FROM "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1"."NATION" AS "t6"
)
SELECT
"t26"."o_year",
"t26"."mkt_share"
"t25"."o_year",
"t25"."mkt_share"
FROM (
SELECT
"t25"."o_year",
SUM("t25"."nation_volume") / SUM("t25"."volume") AS "mkt_share"
"t24"."o_year",
SUM("t24"."nation_volume") / SUM("t24"."volume") AS "mkt_share"
FROM (
SELECT
"t24"."o_year",
"t24"."volume",
"t24"."nation",
"t24"."r_name",
"t24"."o_orderdate",
"t24"."p_type",
CASE WHEN "t24"."nation" = 'BRAZIL' THEN "t24"."volume" ELSE 0 END AS "nation_volume"
"t23"."o_year",
"t23"."volume",
"t23"."nation",
"t23"."r_name",
"t23"."o_orderdate",
"t23"."p_type",
CASE WHEN "t23"."nation" = 'BRAZIL' THEN "t23"."volume" ELSE 0 END AS "nation_volume"
FROM (
SELECT
DATE_PART(year, "t17"."o_orderdate") AS "o_year",
"t15"."l_extendedprice" * (
1 - "t15"."l_discount"
) AS "volume",
"t23"."n_name" AS "nation",
"t22"."n_name" AS "nation",
"t19"."r_name",
"t17"."o_orderdate",
"t14"."p_type"
Expand Down Expand Up @@ -115,16 +115,16 @@ FROM (
FROM "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1"."REGION" AS "t5"
) AS "t19"
ON "t21"."n_regionkey" = "t19"."r_regionkey"
INNER JOIN "t13" AS "t23"
ON "t16"."s_nationkey" = "t23"."n_nationkey"
) AS "t24"
INNER JOIN "t13" AS "t22"
ON "t16"."s_nationkey" = "t22"."n_nationkey"
) AS "t23"
WHERE
"t24"."r_name" = 'AMERICA'
AND "t24"."o_orderdate" BETWEEN DATE_FROM_PARTS(1995, 1, 1) AND DATE_FROM_PARTS(1996, 12, 31)
AND "t24"."p_type" = 'ECONOMY ANODIZED STEEL'
) AS "t25"
"t23"."r_name" = 'AMERICA'
AND "t23"."o_orderdate" BETWEEN DATE_FROM_PARTS(1995, 1, 1) AND DATE_FROM_PARTS(1996, 12, 31)
AND "t23"."p_type" = 'ECONOMY ANODIZED STEEL'
) AS "t24"
GROUP BY
1
) AS "t26"
) AS "t25"
ORDER BY
"t26"."o_year" ASC
"t25"."o_year" ASC
2 changes: 1 addition & 1 deletion ibis/tests/benchmarks/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def eq(a, b):
def multiple_joins(table, num_joins):
for _ in range(num_joins):
table = table.mutate(dummy=ibis.literal(""))
table = table.left_join(table, ["dummy"])[[table]]
table = table.left_join(table.view(), ["dummy"])[[table]]


@pytest.mark.parametrize("num_joins", [1, 10])
Expand Down

0 comments on commit 804d4b5

Please sign in to comment.