Skip to content

Commit b565673

Browse files
committed
New slt rewrite after the rebase
1 parent e0a6d37 commit b565673

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

test/sqllogictest/ldbc_bi.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ Explained Query:
20172017
ArrangeBy keys=[[#0{rootpostlanguage}]] // { arity: 1 }
20182018
Distinct project=[#0{rootpostlanguage}] // { arity: 1 }
20192019
Project (#0{rootpostlanguage}) // { arity: 1 }
2020-
Filter (#0{rootpostlanguage} = varchar_to_text(#1)) // { arity: 2 }
2020+
Filter (#0{rootpostlanguage} = #1) // { arity: 2 }
20212021
FlatMap unnest_array({"es", "ta", "pt"}) // { arity: 2 }
20222022
Distinct project=[#0{rootpostlanguage}] // { arity: 1 }
20232023
Project (#13{rootpostlanguage}) // { arity: 1 }

test/sqllogictest/ldbc_bi_eager.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ Explained Query:
20242024
ArrangeBy keys=[[#0{rootpostlanguage}]] // { arity: 1 }
20252025
Distinct project=[#0{rootpostlanguage}] // { arity: 1 }
20262026
Project (#0{rootpostlanguage}) // { arity: 1 }
2027-
Filter (#0{rootpostlanguage} = varchar_to_text(#1)) // { arity: 2 }
2027+
Filter (#0{rootpostlanguage} = #1) // { arity: 2 }
20282028
FlatMap unnest_array({"es", "ta", "pt"}) // { arity: 2 }
20292029
Distinct project=[#0{rootpostlanguage}] // { arity: 1 }
20302030
Project (#13{rootpostlanguage}) // { arity: 1 }

test/sqllogictest/tpch_create_index.slt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ materialize.public.q02:
282282
ReadIndex on=region pk_region_regionkey=[delta join lookup] // { arity: 3 }
283283
cte l4 =
284284
Project (#0{p_partkey}, #2{p_mfgr}, #10{s_name}, #11{s_address}, #13{s_phone}..=#15{s_comment}, #19{ps_supplycost}, #22{n_name}) // { arity: 9 }
285-
Filter (#5{p_size} = 15) AND (#26{r_name} = "EUROPE") AND like["%BRASS"](varchar_to_text(#4{p_type})) // { arity: 28 }
285+
Filter like["%BRASS"](#4{p_type}) AND (#5{p_size} = 15) AND (#26{r_name} = "EUROPE") // { arity: 28 }
286286
Join on=(#0{p_partkey} = #16{ps_partkey} AND #9{s_suppkey} = #17{ps_suppkey} AND #12{s_nationkey} = #21{n_nationkey} AND #23{n_regionkey} = #25{r_regionkey}) type=delta // { arity: 28 }
287287
implementation
288288
%0:part » %2:l1[#0]KA » %1:l0[#0]KA » %3:l2[#0]KA » %4:l3[#0]KAef
@@ -744,7 +744,7 @@ materialize.public.q08:
744744
Map ((#1{sum} / #2{sum})) // { arity: 4 }
745745
Reduce group_by=[extract_year_d(#2{o_orderdate})] aggregates=[sum(case when (#3{n_name} = "BRAZIL") then (#0{l_extendedprice} * (1 - #1{l_discount})) else 0 end), sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 3 }
746746
Project (#21{l_extendedprice}, #22{l_discount}, #36{o_orderdate}, #54{n_name}) // { arity: 4 }
747-
Filter (#58{r_name} = "AMERICA") AND (#36{o_orderdate} <= 1996-12-31) AND (#36{o_orderdate} >= 1995-01-01) AND ("ECONOMY ANODIZED STEEL" = varchar_to_text(#4{p_type})) // { arity: 60 }
747+
Filter (#4{p_type} = "ECONOMY ANODIZED STEEL") AND (#58{r_name} = "AMERICA") AND (#36{o_orderdate} <= 1996-12-31) AND (#36{o_orderdate} >= 1995-01-01) // { arity: 60 }
748748
Join on=(#0{p_partkey} = #17{l_partkey} AND #9{s_suppkey} = #18{l_suppkey} AND #12{s_nationkey} = #53{n_nationkey} AND #16{l_orderkey} = #32{o_orderkey} AND #33{o_custkey} = #41{c_custkey} AND #44{c_nationkey} = #49{n_nationkey} AND #51{n_regionkey} = #57{r_regionkey}) type=delta // { arity: 60 }
749749
implementation
750750
%0:part » %2:lineitem[#1]KA » %3:orders[#0]KAiif » %1:supplier[#0]KA » %4:customer[#0]KA » %5:nation[#0]KA » %7:region[#0]KAef » %6:nation[#0]KA
@@ -841,7 +841,7 @@ materialize.public.q09_primary_idx:
841841
materialize.public.q09:
842842
Reduce group_by=[#5{n_name}, extract_year_d(#4{o_orderdate})] aggregates=[sum(((#1{l_extendedprice} * (1 - #2{l_discount})) - (#3{ps_supplycost} * #0{l_quantity})))] // { arity: 3 }
843843
Project (#20{l_quantity}..=#22{l_discount}, #35{ps_supplycost}, #41{o_orderdate}, #47{n_name}) // { arity: 6 }
844-
Filter like["%green%"](varchar_to_text(#1{p_name})) // { arity: 50 }
844+
Filter like["%green%"](#1{p_name}) // { arity: 50 }
845845
Join on=(#0{p_partkey} = #17{l_partkey} = #32{ps_partkey} AND #9{s_suppkey} = #18{l_suppkey} = #33{ps_suppkey} AND #12{s_nationkey} = #46{n_nationkey} AND #16{l_orderkey} = #37{o_orderkey}) type=delta // { arity: 50 }
846846
implementation
847847
%0:part » %2:lineitem[#1]KA » %3:partsupp[#0, #1]KKA » %1:supplier[#0]KA » %4:orders[#0]KA » %5:nation[#0]KA
@@ -1145,7 +1145,7 @@ materialize.public.q13:
11451145
ReadIndex on=customer pk_customer_custkey=[differential join] // { arity: 8 }
11461146
cte l1 =
11471147
Project (#0{c_custkey}, #8{o_orderkey}) // { arity: 2 }
1148-
Filter NOT(like["%special%requests%"](varchar_to_text(#16{o_comment}))) // { arity: 17 }
1148+
Filter NOT(like["%special%requests%"](#16{o_comment})) // { arity: 17 }
11491149
Join on=(#0{c_custkey} = #9{o_custkey}) type=differential // { arity: 17 }
11501150
implementation
11511151
%1:orders[#1]KAf » %0:l0[#0]KAf
@@ -1212,7 +1212,7 @@ materialize.public.q14_primary_idx:
12121212
materialize.public.q14:
12131213
With
12141214
cte l0 =
1215-
Reduce aggregates=[sum(case when like["PROMO%"](varchar_to_text(#2{p_type})) then (#0{l_extendedprice} * (1 - #1{l_discount})) else 0 end), sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 }
1215+
Reduce aggregates=[sum(case when like["PROMO%"](#2{p_type}) then (#0{l_extendedprice} * (1 - #1{l_discount})) else 0 end), sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 }
12161216
Project (#5{l_extendedprice}, #6{l_discount}, #20{p_type}) // { arity: 3 }
12171217
Filter (#10{l_shipdate} >= 1995-09-01) AND (date_to_timestamp(#10{l_shipdate}) < 1995-10-01 00:00:00) // { arity: 25 }
12181218
Join on=(#1{l_partkey} = #16{p_partkey}) type=differential // { arity: 25 }
@@ -1370,7 +1370,7 @@ materialize.public.q16:
13701370
With
13711371
cte l0 =
13721372
Project (#1{ps_suppkey}, #8{p_brand}..=#10{p_size}) // { arity: 4 }
1373-
Filter (#8{p_brand} != "Brand#45") AND NOT(like["MEDIUM POLISHED%"](varchar_to_text(#9{p_type}))) AND ((#10{p_size} = 3) OR (#10{p_size} = 9) OR (#10{p_size} = 14) OR (#10{p_size} = 19) OR (#10{p_size} = 23) OR (#10{p_size} = 36) OR (#10{p_size} = 45) OR (#10{p_size} = 49)) // { arity: 14 }
1373+
Filter (#8{p_brand} != "Brand#45") AND NOT(like["MEDIUM POLISHED%"](#9{p_type})) AND ((#10{p_size} = 3) OR (#10{p_size} = 9) OR (#10{p_size} = 14) OR (#10{p_size} = 19) OR (#10{p_size} = 23) OR (#10{p_size} = 36) OR (#10{p_size} = 45) OR (#10{p_size} = 49)) // { arity: 14 }
13741374
Join on=(#0{ps_partkey} = #5{p_partkey}) type=differential // { arity: 14 }
13751375
implementation
13761376
%1:part[#0]KAef » %0:partsupp[#0]KAef
@@ -1403,7 +1403,7 @@ materialize.public.q16:
14031403
Get l1 // { arity: 1 }
14041404
ArrangeBy keys=[[]] // { arity: 1 }
14051405
Project (#0{s_suppkey}) // { arity: 1 }
1406-
Filter like["%Customer%Complaints%"](varchar_to_text(#6{s_comment})) // { arity: 7 }
1406+
Filter like["%Customer%Complaints%"](#6{s_comment}) // { arity: 7 }
14071407
ReadIndex on=supplier pk_supplier_suppkey=[*** full scan ***] // { arity: 7 }
14081408
Get l1 // { arity: 1 }
14091409

@@ -1762,7 +1762,7 @@ materialize.public.q20:
17621762
ArrangeBy keys=[[#0{p_partkey}]] // { arity: 1 }
17631763
Distinct project=[#0{p_partkey}] // { arity: 1 }
17641764
Project (#0{p_partkey}) // { arity: 1 }
1765-
Filter (#0{p_partkey}) IS NOT NULL AND like["forest%"](varchar_to_text(#1{p_name})) // { arity: 9 }
1765+
Filter like["forest%"](#1{p_name}) AND (#0{p_partkey}) IS NOT NULL // { arity: 9 }
17661766
ReadIndex on=part pk_part_partkey=[*** full scan ***] // { arity: 9 }
17671767
Return // { arity: 2 }
17681768
Project (#1{s_name}, #2{s_address}) // { arity: 2 }

test/sqllogictest/tpch_create_materialized_view.slt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ materialize.public.q02:
261261
ReadIndex on=region pk_region_regionkey=[delta join lookup] // { arity: 3 }
262262
cte l4 =
263263
Project (#0{p_partkey}, #2{p_mfgr}, #10{s_name}, #11{s_address}, #13{s_phone}..=#15{s_comment}, #19{ps_supplycost}, #22{n_name}) // { arity: 9 }
264-
Filter (#5{p_size} = 15) AND (#26{r_name} = "EUROPE") AND like["%BRASS"](varchar_to_text(#4{p_type})) // { arity: 28 }
264+
Filter like["%BRASS"](#4{p_type}) AND (#5{p_size} = 15) AND (#26{r_name} = "EUROPE") // { arity: 28 }
265265
Join on=(#0{p_partkey} = #16{ps_partkey} AND #9{s_suppkey} = #17{ps_suppkey} AND #12{s_nationkey} = #21{n_nationkey} AND #23{n_regionkey} = #25{r_regionkey}) type=delta // { arity: 28 }
266266
implementation
267267
%0:part » %2:l1[#0]KA » %1:l0[#0]KA » %3:l2[#0]KA » %4:l3[#0]KAef
@@ -669,7 +669,7 @@ materialize.public.q08:
669669
Map ((#1{sum} / #2{sum})) // { arity: 4 }
670670
Reduce group_by=[extract_year_d(#2{o_orderdate})] aggregates=[sum(case when (#3{n_name} = "BRAZIL") then (#0{l_extendedprice} * (1 - #1{l_discount})) else 0 end), sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 3 }
671671
Project (#21{l_extendedprice}, #22{l_discount}, #36{o_orderdate}, #54{n_name}) // { arity: 4 }
672-
Filter (#58{r_name} = "AMERICA") AND (#36{o_orderdate} <= 1996-12-31) AND (#36{o_orderdate} >= 1995-01-01) AND ("ECONOMY ANODIZED STEEL" = varchar_to_text(#4{p_type})) // { arity: 60 }
672+
Filter (#4{p_type} = "ECONOMY ANODIZED STEEL") AND (#58{r_name} = "AMERICA") AND (#36{o_orderdate} <= 1996-12-31) AND (#36{o_orderdate} >= 1995-01-01) // { arity: 60 }
673673
Join on=(#0{p_partkey} = #17{l_partkey} AND #9{s_suppkey} = #18{l_suppkey} AND #12{s_nationkey} = #53{n_nationkey} AND #16{l_orderkey} = #32{o_orderkey} AND #33{o_custkey} = #41{c_custkey} AND #44{c_nationkey} = #49{n_nationkey} AND #51{n_regionkey} = #57{r_regionkey}) type=delta // { arity: 60 }
674674
implementation
675675
%0:part » %2:lineitem[#1]KA » %3:orders[#0]KAiif » %1:supplier[#0]KA » %4:customer[#0]KA » %5:nation[#0]KA » %7:region[#0]KAef » %6:nation[#0]KA
@@ -757,7 +757,7 @@ ORDER BY
757757
materialize.public.q09:
758758
Reduce group_by=[#5{n_name}, extract_year_d(#4{o_orderdate})] aggregates=[sum(((#1{l_extendedprice} * (1 - #2{l_discount})) - (#3{ps_supplycost} * #0{l_quantity})))] // { arity: 3 }
759759
Project (#20{l_quantity}..=#22{l_discount}, #35{ps_supplycost}, #41{o_orderdate}, #47{n_name}) // { arity: 6 }
760-
Filter like["%green%"](varchar_to_text(#1{p_name})) // { arity: 50 }
760+
Filter like["%green%"](#1{p_name}) // { arity: 50 }
761761
Join on=(#0{p_partkey} = #17{l_partkey} = #32{ps_partkey} AND #9{s_suppkey} = #18{l_suppkey} = #33{ps_suppkey} AND #12{s_nationkey} = #46{n_nationkey} AND #16{l_orderkey} = #37{o_orderkey}) type=delta // { arity: 50 }
762762
implementation
763763
%0:part » %2:lineitem[#1]KA » %3:partsupp[#0, #1]KKA » %1:supplier[#0]KA » %4:orders[#0]KA » %5:nation[#0]KA
@@ -1025,7 +1025,7 @@ materialize.public.q13:
10251025
ReadIndex on=customer pk_customer_custkey=[differential join] // { arity: 8 }
10261026
cte l1 =
10271027
Project (#0{c_custkey}, #8{o_orderkey}) // { arity: 2 }
1028-
Filter NOT(like["%special%requests%"](varchar_to_text(#16{o_comment}))) // { arity: 17 }
1028+
Filter NOT(like["%special%requests%"](#16{o_comment})) // { arity: 17 }
10291029
Join on=(#0{c_custkey} = #9{o_custkey}) type=differential // { arity: 17 }
10301030
implementation
10311031
%1:orders[#1]KAf » %0:l0[#0]KAf
@@ -1083,7 +1083,7 @@ WHERE
10831083
materialize.public.q14:
10841084
With
10851085
cte l0 =
1086-
Reduce aggregates=[sum(case when like["PROMO%"](varchar_to_text(#2{p_type})) then (#0{l_extendedprice} * (1 - #1{l_discount})) else 0 end), sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 }
1086+
Reduce aggregates=[sum(case when like["PROMO%"](#2{p_type}) then (#0{l_extendedprice} * (1 - #1{l_discount})) else 0 end), sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 }
10871087
Project (#5{l_extendedprice}, #6{l_discount}, #20{p_type}) // { arity: 3 }
10881088
Filter (#10{l_shipdate} >= 1995-09-01) AND (date_to_timestamp(#10{l_shipdate}) < 1995-10-01 00:00:00) // { arity: 25 }
10891089
Join on=(#1{l_partkey} = #16{p_partkey}) type=differential // { arity: 25 }
@@ -1226,7 +1226,7 @@ materialize.public.q16:
12261226
With
12271227
cte l0 =
12281228
Project (#1{ps_suppkey}, #8{p_brand}..=#10{p_size}) // { arity: 4 }
1229-
Filter (#8{p_brand} != "Brand#45") AND NOT(like["MEDIUM POLISHED%"](varchar_to_text(#9{p_type}))) AND ((#10{p_size} = 3) OR (#10{p_size} = 9) OR (#10{p_size} = 14) OR (#10{p_size} = 19) OR (#10{p_size} = 23) OR (#10{p_size} = 36) OR (#10{p_size} = 45) OR (#10{p_size} = 49)) // { arity: 14 }
1229+
Filter (#8{p_brand} != "Brand#45") AND NOT(like["MEDIUM POLISHED%"](#9{p_type})) AND ((#10{p_size} = 3) OR (#10{p_size} = 9) OR (#10{p_size} = 14) OR (#10{p_size} = 19) OR (#10{p_size} = 23) OR (#10{p_size} = 36) OR (#10{p_size} = 45) OR (#10{p_size} = 49)) // { arity: 14 }
12301230
Join on=(#0{ps_partkey} = #5{p_partkey}) type=differential // { arity: 14 }
12311231
implementation
12321232
%1:part[#0]KAef » %0:partsupp[#0]KAef
@@ -1259,7 +1259,7 @@ materialize.public.q16:
12591259
Get l1 // { arity: 1 }
12601260
ArrangeBy keys=[[]] // { arity: 1 }
12611261
Project (#0{s_suppkey}) // { arity: 1 }
1262-
Filter like["%Customer%Complaints%"](varchar_to_text(#6{s_comment})) // { arity: 7 }
1262+
Filter like["%Customer%Complaints%"](#6{s_comment}) // { arity: 7 }
12631263
ReadIndex on=supplier pk_supplier_suppkey=[*** full scan ***] // { arity: 7 }
12641264
Get l1 // { arity: 1 }
12651265

@@ -1582,7 +1582,7 @@ materialize.public.q20:
15821582
ArrangeBy keys=[[#0{p_partkey}]] // { arity: 1 }
15831583
Distinct project=[#0{p_partkey}] // { arity: 1 }
15841584
Project (#0{p_partkey}) // { arity: 1 }
1585-
Filter (#0{p_partkey}) IS NOT NULL AND like["forest%"](varchar_to_text(#1{p_name})) // { arity: 9 }
1585+
Filter like["forest%"](#1{p_name}) AND (#0{p_partkey}) IS NOT NULL // { arity: 9 }
15861586
ReadIndex on=part pk_part_partkey=[*** full scan ***] // { arity: 9 }
15871587
Return // { arity: 2 }
15881588
Project (#1{s_name}, #2{s_address}) // { arity: 2 }

0 commit comments

Comments
 (0)