From cdbb5b6756a82498f28aa68350bb448cf2c84dd7 Mon Sep 17 00:00:00 2001 From: Alexander Alexandrov Date: Thu, 9 Nov 2023 12:57:08 +0200 Subject: [PATCH] explain: change output of non-binary equivalence classes --- src/compute-types/src/explain/text.rs | 12 +++---- src/expr-parser/src/parser.rs | 35 +++++++++++++------ .../tests/test_mir_parser/join.spec | 4 +-- src/expr/src/explain/text.rs | 9 ++--- src/transform/tests/test_transforms/anf.spec | 4 +-- .../tests/test_transforms/typecheck.spec | 4 +-- src/transform/tests/testdata/join-fusion | 6 ++-- .../tests/testdata/partial-reduction-pushdown | 6 ++-- .../tests/testdata/reduction-pushdown | 6 ++-- test/sqllogictest/cardinality.slt | 2 +- test/sqllogictest/chbench.slt | 20 +++++------ .../explain/decorrelated_plan_as_text.slt | 2 +- .../explain/optimized_plan_as_text.slt | 8 ++--- test/sqllogictest/joins.slt | 2 +- test/sqllogictest/ldbc_bi.slt | 24 ++++++------- test/sqllogictest/not-null-propagation.slt | 4 +-- .../scalar_subqueries_select_list.slt | 8 ++--- test/sqllogictest/tpch_create_index.slt | 6 ++-- .../tpch_create_materialized_view.slt | 6 ++-- test/sqllogictest/tpch_select.slt | 6 ++-- test/sqllogictest/transform/join_index.slt | 6 ++-- test/sqllogictest/transform/relation_cse.slt | 2 +- 22 files changed, 94 insertions(+), 88 deletions(-) diff --git a/src/compute-types/src/explain/text.rs b/src/compute-types/src/explain/text.rs index a72186e2605b4..87971636bdddc 100644 --- a/src/compute-types/src/explain/text.rs +++ b/src/compute-types/src/explain/text.rs @@ -26,7 +26,7 @@ use std::ops::Deref; use itertools::{izip, Itertools}; use mz_expr::{Id, MirScalarExpr}; -use mz_ore::str::{bracketed, separated, IndentLike, StrExt}; +use mz_ore::str::{separated, IndentLike, StrExt}; use mz_repr::explain::text::{fmt_text_constant_rows, DisplayText}; use mz_repr::explain::{CompactScalarSeq, Indices, PlanRenderingContext}; @@ -575,13 +575,9 @@ impl DisplayText> for JoinClosure { if !self.ready_equivalences.is_empty() { let equivalences = separated( " AND ", - self.ready_equivalences.iter().map(|equivalence| { - if equivalence.len() == 2 { - bracketed("", "", separated(" = ", equivalence)) - } else { - bracketed("eq(", ")", separated(", ", equivalence)) - } - }), + self.ready_equivalences + .iter() + .map(|equivalence| separated(" = ", equivalence)), ); writeln!(f, "{}ready_equivalences={}", ctx.indent, equivalences)?; } diff --git a/src/expr-parser/src/parser.rs b/src/expr-parser/src/parser.rs index 5d24209573f1c..8f693d4b9187c 100644 --- a/src/expr-parser/src/parser.rs +++ b/src/expr-parser/src/parser.rs @@ -656,7 +656,7 @@ mod relation { /// Support for parsing [mz_expr::MirScalarExpr]. mod scalar { - use mz_expr::{ColumnOrder, MirScalarExpr}; + use mz_expr::{BinaryFunc, ColumnOrder, MirScalarExpr}; use mz_repr::{AsColumnType, Datum, Row}; use super::*; @@ -1020,16 +1020,31 @@ mod scalar { pub fn parse_join_equivalences(input: ParseStream) -> syn::Result>> { let mut equivalences = vec![]; while !input.is_empty() { - if input.eat(kw::eq) { - let inner; - syn::parenthesized!(inner in input); - equivalences.push(inner.parse_comma_sep(parse_expr)?); - } else { - let lhs = parse_operand(input)?; - input.parse::()?; - let rhs = parse_operand(input)?; - equivalences.push(vec![lhs, rhs]); + let mut equivalence = vec![]; + loop { + let mut worklist = vec![parse_operand(input)?]; + while let Some(operand) = worklist.pop() { + // Be more lenient and support parenthesized equivalences, + // e.g. `... AND (x = u + v = z + 1) AND ...`. + if let MirScalarExpr::CallBinary { + func: BinaryFunc::Eq, + expr1, + expr2, + } = operand + { + // We reverse the order in the worklist in order to get + // the correct order in the equivalence class. + worklist.push(*expr2); + worklist.push(*expr1); + } else { + equivalence.push(operand); + } + } + if !input.eat(syn::Token![=]) { + break; + } } + equivalences.push(equivalence); input.eat(kw::AND); } Ok(equivalences) diff --git a/src/expr-parser/tests/test_mir_parser/join.spec b/src/expr-parser/tests/test_mir_parser/join.spec index 6a2601cc6e166..a56e26da3aa92 100644 --- a/src/expr-parser/tests/test_mir_parser/join.spec +++ b/src/expr-parser/tests/test_mir_parser/join.spec @@ -20,7 +20,7 @@ roundtrip OK # Equi-Join roundtrip -Join on=((#1 + #2) = #4 AND eq(#0, #3, #6) AND #5 = #8) +Join on=((#1 + #2) = #4 AND #0 = #3 = #6 = #7 AND #5 = #8) Constant // { types: "(bigint, bigint, text)" } - (1, 2, "oh, my!") Constant // { types: "(bigint, bigint, text)" } @@ -32,7 +32,7 @@ roundtrip OK # Equi-Join roundtrip -Join on=((#0 + #1) = #3 AND eq(#2, #5, #8) AND #4 = (#6 + #7)) +Join on=((#0 + #1) = #3 AND #2 = #5 = #8 AND #4 = (#6 + #7)) Constant // { types: "(bigint, bigint, text)" } - (1, 2, "oh, my!") Constant // { types: "(bigint, bigint, text)" } diff --git a/src/expr/src/explain/text.rs b/src/expr/src/explain/text.rs index 671498884a904..65cc7260787ad 100644 --- a/src/expr/src/explain/text.rs +++ b/src/expr/src/explain/text.rs @@ -13,7 +13,7 @@ use std::collections::BTreeMap; use std::fmt; use mz_ore::soft_assert; -use mz_ore::str::{bracketed, closure_to_display, separated, Indent, IndentLike, StrExt}; +use mz_ore::str::{closure_to_display, separated, Indent, IndentLike, StrExt}; use mz_repr::explain::text::{fmt_text_constant_rows, DisplayText}; use mz_repr::explain::{ CompactScalarSeq, ExprHumanizer, HumanizedAttributes, IndexUsageType, Indices, @@ -545,13 +545,8 @@ impl MirRelationExpr { let equivalences = separated( " AND ", equivalences.iter().map(|equivalence| { - let equivalences = equivalence.len(); let equivalence = HumanizedExpr::seq(equivalence, cols); - if equivalences == 2 { - bracketed("", "", separated(" = ", equivalence)) - } else { - bracketed("eq(", ")", separated(", ", equivalence)) - } + separated(" = ", equivalence) }), ); write!(f, "{}Join on=({})", ctx.indent, equivalences)?; diff --git a/src/transform/tests/test_transforms/anf.spec b/src/transform/tests/test_transforms/anf.spec index 17942261f0a17..77522cf638ab8 100644 --- a/src/transform/tests/test_transforms/anf.spec +++ b/src/transform/tests/test_transforms/anf.spec @@ -63,7 +63,7 @@ With # Joins. apply pipeline=anf -Join on=(eq(#0, #2, #4)) +Join on=(#0 = #2 = #4) Get t0 Constant // { types: "(bigint, bigint)" } Get t0 @@ -72,7 +72,7 @@ Return Get l2 With cte l2 = - Join on=(eq(#0, #2, #4)) + Join on=(#0 = #2 = #4) Get l0 Get l1 Get l0 diff --git a/src/transform/tests/test_transforms/typecheck.spec b/src/transform/tests/test_transforms/typecheck.spec index 1c9694989a792..9b8982ab87b1f 100644 --- a/src/transform/tests/test_transforms/typecheck.spec +++ b/src/transform/tests/test_transforms/typecheck.spec @@ -353,7 +353,7 @@ expected Bool? ############################################################################ typecheck -Join on=(eq(#0, #3)) +Join on=(#0 = #3) Get t0 Get t0 ---- @@ -361,7 +361,7 @@ Join on=(eq(#0, #3)) # TODO(mgree): should narrow to non-null with typechecker improvements typecheck -Join on=(eq(#0, #1, #3, #4)) +Join on=(#0 = #1 = #3 = #4) Get t0 Get t0 ---- diff --git a/src/transform/tests/testdata/join-fusion b/src/transform/tests/testdata/join-fusion index 84e557f0f717a..2b7de1f161ade 100644 --- a/src/transform/tests/testdata/join-fusion +++ b/src/transform/tests/testdata/join-fusion @@ -41,7 +41,7 @@ build apply=JoinFusion [[#0 #2]]) ---- Filter #3 - Join on=(eq(#0, #2, #4)) + Join on=(#0 = #2 = #4) Get x Get x Get y @@ -72,7 +72,7 @@ build apply=JoinFusion [[#0 #2 #6]]) ---- Filter #3 - Join on=(eq(#0, #2, #4, #6)) + Join on=(#0 = #2 = #4 = #6) Get x Get x Get y @@ -90,7 +90,7 @@ build apply=(JoinFusion,PredicatePushdown) [#1])] [[#0 #2 #6]]) ---- -Join on=(eq(#0, #2, #4, #6)) +Join on=(#0 = #2 = #4 = #6) Get x Filter #1 Get x diff --git a/src/transform/tests/testdata/partial-reduction-pushdown b/src/transform/tests/testdata/partial-reduction-pushdown index 0e8b175d8af9b..8120a380245ce 100644 --- a/src/transform/tests/testdata/partial-reduction-pushdown +++ b/src/transform/tests/testdata/partial-reduction-pushdown @@ -159,7 +159,7 @@ build apply=ReductionPushdown []) ---- Project (#0) - Join on=(eq(#0, #1, #2)) + Join on=(#0 = #1 = #2) Distinct project=[#1] Get x Distinct project=[#1] @@ -267,7 +267,7 @@ build apply=ReductionPushdown [(sum_int32 (call_unary neg_int32 #0) true) (sum_int16 #2 true)]) ---- Project (#2, #1, #3) - Join on=(eq(#0, #2, #4)) + Join on=(#0 = #2 = #4) Reduce group_by=[#1] aggregates=[sum(distinct -(#0))] Constant Reduce group_by=[#1] aggregates=[sum(distinct #0)] @@ -292,7 +292,7 @@ build apply=ReductionPushdown Project (#3, #1, #2) Join on=(#0 = #3) Reduce group_by=[#4] aggregates=[sum(distinct (#0 + smallint_to_integer(#2))), sum(distinct (#2 * #4))] - Join on=(eq(#1, #3, #5)) + Join on=(#1 = #3 = #5) Constant Constant Constant diff --git a/src/transform/tests/testdata/reduction-pushdown b/src/transform/tests/testdata/reduction-pushdown index 9cdd0c6ade6fa..05f692e062319 100644 --- a/src/transform/tests/testdata/reduction-pushdown +++ b/src/transform/tests/testdata/reduction-pushdown @@ -128,7 +128,7 @@ build apply=ReductionPushdown (reduce (join [(get x) (get y) (get y)] [[#1 #3 #5]]) [#1] []) ---- Project (#0) - Join on=(eq(#0, #1, #2)) + Join on=(#0 = #1 = #2) Distinct project=[#1] Get x Distinct project=[#1] @@ -282,7 +282,7 @@ build apply=ReductionPushdown [(sum_int16 (call_unary neg_int16 #0) true) (sum_int16 #2 true)]) ---- Project (#2, #1, #3) - Join on=(eq(#0, #2, #4)) + Join on=(#0 = #2 = #4) Reduce group_by=[#1] aggregates=[sum(distinct -(#0))] Get x Reduce group_by=[#1] aggregates=[sum(distinct #0)] @@ -302,7 +302,7 @@ build apply=ReductionPushdown Project (#3, #1, #2) Join on=(#0 = #3) Reduce group_by=[#4] aggregates=[sum(distinct (#0 + #2)), sum(distinct (#2 * #4))] - Join on=(eq(#1, #3, #5)) + Join on=(#1 = #3 = #5) Get x Get y Get z diff --git a/test/sqllogictest/cardinality.slt b/test/sqllogictest/cardinality.slt index 220f09b3889ab..c360a504495a7 100644 --- a/test/sqllogictest/cardinality.slt +++ b/test/sqllogictest/cardinality.slt @@ -556,7 +556,7 @@ EXPLAIN WITH(join_impls) SELECT * FROM t JOIN t2 ON t.x = t2.x JOIN t3 ON t.x = ---- Explained Query: Project (#0, #1, #0, #3, #0, #5, #0, #7, #0, #9, #0, #11, #0, #13, #0, #15, #0, #17, #0, #19) - Join on=(eq(#0, #2, #4, #6, #8, #10, #12, #14, #16, #18)) type=delta + Join on=(#0 = #2 = #4 = #6 = #8 = #10 = #12 = #14 = #16 = #18) type=delta implementation %0:t » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000| %1:t2 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| diff --git a/test/sqllogictest/chbench.slt b/test/sqllogictest/chbench.slt index 211f821fed323..099b12c54d7f3 100644 --- a/test/sqllogictest/chbench.slt +++ b/test/sqllogictest/chbench.slt @@ -308,7 +308,7 @@ Explained Query: Return // { arity: 8 } Project (#2, #3, #12, #0, #1, #4, #6, #7) // { arity: 8 } Filter (#9) IS NOT NULL // { arity: 17 } - Join on=(eq(#0, #8, #15) AND #2 = #10 AND #5 = #11 AND #9 = #16 AND #13 = #14) type=differential // { arity: 17 } + Join on=(#0 = #8 = #15 AND #2 = #10 AND #5 = #11 AND #9 = #16 AND #13 = #14) type=differential // { arity: 17 } implementation %5[#0]UKA » %0:item[#0]UKlf » %2:stock[#0, #1]KKlf » %1:supplier[#0]UKlf » %3:nation[#0]UKlf » %4:l0[#0]UKlf ArrangeBy keys=[[#0]] // { arity: 2 } @@ -383,7 +383,7 @@ Explained Query: Reduce group_by=[#2, #1, #0, #3] aggregates=[sum(#4)] // { arity: 5 } Project (#1..=#3, #10, #22) // { arity: 5 } Filter (#0) IS NOT NULL AND (date_to_timestamp(#10) > 2007-01-02 00:00:00) // { arity: 24 } - Join on=(#0 = #9 AND eq(#1, #4, #7, #15) AND eq(#2, #5, #8, #16) AND eq(#3, #6, #14)) type=differential // { arity: 24 } + Join on=(#0 = #9 AND #1 = #4 = #7 = #15 AND #2 = #5 = #8 = #16 AND #3 = #6 = #14) type=differential // { arity: 24 } implementation %0:customer[#2, #1, #0]UKKKlf » %2:order[#2, #1, #3]KKKAlif » %1:neworder[#0..=#2]UKKKlif » %3:orderline[#2, #1, #0]KKKAlif ArrangeBy keys=[[#2, #1, #0]] // { arity: 3 } @@ -486,7 +486,7 @@ Explained Query: Reduce group_by=[#1] aggregates=[sum(#0)] // { arity: 2 } Project (#16, #24) // { arity: 2 } Filter (#12) IS NOT NULL // { arity: 27 } - Join on=(#0 = #7 AND eq(#1, #5, #9) AND eq(#2, #6, #10, #19) AND eq(#3, #22, #23) AND #4 = #8 AND #12 = #18 AND #20 = #21 AND #25 = #26) type=differential // { arity: 27 } + Join on=(#0 = #7 AND #1 = #5 = #9 AND #2 = #6 = #10 = #19 AND #3 = #22 = #23 AND #4 = #8 AND #12 = #18 AND #20 = #21 AND #25 = #26) type=differential // { arity: 27 } implementation %1:order[#3, #1, #2]KKKif » %0:customer[#0..=#2]UKKKif » %5:nation[#0]UKif » %6:region[#0]UKeif » %2:orderline[#2, #1, #0]KKKAeif » %3:stock[#0, #1]UKKeif » %4:supplier[#0, #1]UKKeif ArrangeBy keys=[[#0..=#2]] // { arity: 4 } @@ -594,7 +594,7 @@ Explained Query: Reduce group_by=[#0, substr(char_to_text(#3), 1, 1), extract_year_d(#2)] aggregates=[sum(#1)] // { arity: 4 } Project (#1, #10, #15, #19) // { arity: 4 } Filter (((#22 = "GERMANY") AND (#24 = "CAMBODIA")) OR ((#22 = "CAMBODIA") AND (#24 = "GERMANY"))) // { arity: 25 } - Join on=(#0 = #4 AND #1 = #21 AND #2 = #8 AND #3 = #9 AND #5 = #11 AND eq(#6, #12, #17) AND eq(#7, #13, #18) AND #14 = #16 AND #20 = #23) type=differential // { arity: 25 } + Join on=(#0 = #4 AND #1 = #21 AND #2 = #8 AND #3 = #9 AND #5 = #11 AND #6 = #12 = #17 AND #7 = #13 = #18 AND #14 = #16 AND #20 = #23) type=differential // { arity: 25 } implementation %2:orderline[#0..=#2]KKKiif » %3:order[#0..=#2]UKKKiif » %4:customer[#0..=#2]UKKKiif » %1:stock[#0, #1]UKKiif » %6:l0[#0]UKeiif » %0:supplier[#0]UKeiif » %5:l0[#0]UKeiif ArrangeBy keys=[[#0]] // { arity: 2 } @@ -670,7 +670,7 @@ Explained Query: Reduce group_by=[extract_year_d(#1)] aggregates=[sum(case when (#2 = "GERMANY") then #0 else 0 end), sum(#0)] // { arity: 3 } Project (#14, #20, #28) // { arity: 3 } Filter (#0 < 1000) AND (#4) IS NOT NULL // { arity: 30 } - Join on=(eq(#0, #3, #10) AND #1 = #5 AND #2 = #27 AND #4 = #11 AND #6 = #16 AND eq(#7, #17, #22) AND eq(#8, #18, #23) AND #19 = #21 AND #24 = #25 AND #26 = #29) type=differential // { arity: 30 } + Join on=(#0 = #3 = #10 AND #1 = #5 AND #2 = #27 AND #4 = #11 AND #6 = #16 AND #7 = #17 = #22 AND #8 = #18 = #23 AND #19 = #21 AND #24 = #25 AND #26 = #29) type=differential // { arity: 30 } implementation %4:order[#3, #1, #2]KKKiif » %5:customer[#0..=#2]UKKKiif » %6:nation[#0]UKiif » %8:region[#0]UKeiif » %3:orderline[#2, #1, #0]KKKAeiiif » %2:stock[#0, #1]UKKeiiiif » %0:item[#0]UKeliiiiif » %1:supplier[#0]UKeliiiiif » %7:nation[#0]UKeliiiiif ArrangeBy keys=[[#0]] // { arity: 1 } @@ -745,7 +745,7 @@ Explained Query: Reduce group_by=[#2, extract_year_d(#1)] aggregates=[sum(#0)] // { arity: 3 } Project (#14, #19, #21) // { arity: 3 } Filter (#0) IS NOT NULL AND (#2) IS NOT NULL // { arity: 22 } - Join on=(eq(#0, #1, #10) AND #2 = #11 AND #3 = #4 AND #5 = #20 AND #6 = #16 AND #7 = #17 AND #8 = #18) type=differential // { arity: 22 } + Join on=(#0 = #1 = #10 AND #2 = #11 AND #3 = #4 AND #5 = #20 AND #6 = #16 AND #7 = #17 AND #8 = #18) type=differential // { arity: 22 } implementation %4:order[#2, #1, #0]UKKK » %3:orderline[#2, #1, #0]KKKA » %1:stock[#0, #1]UKK » %0:item[#0]UKlf » %2:supplier[#0]UKlf » %5:nation[#0]UKlf ArrangeBy keys=[[#0]] // { arity: 1 } @@ -803,7 +803,7 @@ Explained Query: Reduce group_by=[#0..=#3, #5] aggregates=[sum(#4)] // { arity: 6 } Project (#0, #3..=#5, #20, #23) // { arity: 6 } Filter (#11 <= #18) // { arity: 24 } - Join on=(#0 = #10 AND eq(#1, #8, #13) AND eq(#2, #9, #14) AND #6 = #22 AND #7 = #12) type=differential // { arity: 24 } + Join on=(#0 = #10 AND #1 = #8 = #13 AND #2 = #9 = #14 AND #6 = #22 AND #7 = #12) type=differential // { arity: 24 } implementation %1:order[#3, #1, #2]KKKif » %0:customer[#0..=#2]UKKKif » %3:nation[#0]UKif » %2:orderline[#2, #1, #0]KKKAif ArrangeBy keys=[[#0..=#2]] // { arity: 7 } @@ -1238,7 +1238,7 @@ Explained Query: Reduce group_by=[#4, #2, #1, #0, #3, #5, #6] aggregates=[sum(#7)] // { arity: 8 } Project (#0..=#4, #8, #10, #20) // { arity: 8 } Filter (#0) IS NOT NULL // { arity: 22 } - Join on=(#0 = #7 AND eq(#1, #5, #13) AND eq(#2, #6, #14) AND #4 = #12) type=differential // { arity: 22 } + Join on=(#0 = #7 AND #1 = #5 = #13 AND #2 = #6 = #14 AND #4 = #12) type=differential // { arity: 22 } implementation %0:customer[#2, #1, #0]UKKK » %1:order[#2, #1, #3]KKKA » %2:orderline[#2, #1, #0]KKKA ArrangeBy keys=[[#2, #1, #0]] // { arity: 4 } @@ -1360,7 +1360,7 @@ Explained Query: Reduce group_by=[#0..=#3] aggregates=[sum(#4)] // { arity: 5 } Project (#0..=#3, #26) // { arity: 5 } Filter (#1) IS NOT NULL AND (date_to_timestamp(#25) > 2010-05-23 12:00:00) // { arity: 30 } - Join on=(#0 = ((#1 * #2) % 10000) AND eq(#1, #23, #29)) type=differential // { arity: 30 } + Join on=(#0 = ((#1 * #2) % 10000) AND #1 = #23 = #29) type=differential // { arity: 30 } implementation %3:item[#0]UKlf » %2:orderline[#4]KAlif » %1:stock[#0]KAlif » %0:l0[#0]UKlif ArrangeBy keys=[[#0]] // { arity: 1 } @@ -1456,7 +1456,7 @@ Explained Query: cte l1 = Project (#1, #3..=#5, #9) // { arity: 5 } Filter (#7) IS NOT NULL AND (#9 > #16) // { arity: 21 } - Join on=(#0 = #19 AND #2 = #20 AND #3 = #13 AND #4 = #14 AND eq(#5, #15, #18) AND #7 = #17) type=differential // { arity: 21 } + Join on=(#0 = #19 AND #2 = #20 AND #3 = #13 AND #4 = #14 AND #5 = #15 = #18 AND #7 = #17) type=differential // { arity: 21 } implementation %2:order[#2, #1, #0]UKKK » %1:l0[#2, #1, #0]KKKA » %3:stock[#0, #1]UKK » %0:supplier[#0]UK » %4:nation[#0]UKef ArrangeBy keys=[[#0]] // { arity: 3 } diff --git a/test/sqllogictest/explain/decorrelated_plan_as_text.slt b/test/sqllogictest/explain/decorrelated_plan_as_text.slt index 4b31bc070dceb..c537667a02af1 100644 --- a/test/sqllogictest/explain/decorrelated_plan_as_text.slt +++ b/test/sqllogictest/explain/decorrelated_plan_as_text.slt @@ -294,7 +294,7 @@ SELECT (SELECT v.a FROM v WHERE v.b = t.b LIMIT 1), (SELECT mv.a FROM mv WHERE m Return Project (#8, #9) Map (#4, #7) - Join on=(eq(#0, #2, #5) AND eq(#1, #3, #6)) + Join on=(#0 = #2 = #5 AND #1 = #3 = #6) Get l0 Project (#0, #1, #3) Join on=(#1 = #2) diff --git a/test/sqllogictest/explain/optimized_plan_as_text.slt b/test/sqllogictest/explain/optimized_plan_as_text.slt index bf0b38c22b157..093b384021490 100644 --- a/test/sqllogictest/explain/optimized_plan_as_text.slt +++ b/test/sqllogictest/explain/optimized_plan_as_text.slt @@ -306,7 +306,7 @@ SELECT (SELECT iv.a FROM iv WHERE iv.b = t.b LIMIT 1), (SELECT mv.a FROM mv WHER Explained Query: Return Project (#2, #4) - Join on=(eq(#0, #1, #3)) type=delta + Join on=(#0 = #1 = #3) type=delta ArrangeBy keys=[[#0]] Get l0 ArrangeBy keys=[[#0]] @@ -394,7 +394,7 @@ Explained Query: With cte l2 = Project (#0..=#2) - Join on=(eq(#1, #3, #4)) type=delta + Join on=(#1 = #3 = #4) type=delta Get l1 Get l1 ArrangeBy keys=[[#0]] @@ -591,7 +591,7 @@ WHERE t1.b = t2.b AND t2.b = t3.b Explained Query: Return Project (#0, #2) - Join on=(eq(#1, #3, #4)) type=delta + Join on=(#1 = #3 = #4) type=delta Get l1 Get l1 ArrangeBy keys=[[#0]] @@ -1036,7 +1036,7 @@ Explained Query: Return Project (#0, #1, #0, #3, #0, #5) Filter (#0) IS NOT NULL - Join on=(eq(#0, #2, #4)) type=delta + Join on=(#0 = #2 = #4) type=delta Get l0 Get l0 Get l0 diff --git a/test/sqllogictest/joins.slt b/test/sqllogictest/joins.slt index 78cbf9f3c6d61..7aa4522da6099 100644 --- a/test/sqllogictest/joins.slt +++ b/test/sqllogictest/joins.slt @@ -169,7 +169,7 @@ Explained Query: ArrangeBy keys=[[#0]] // { arity: 1 } Distinct project=[#0] // { arity: 1 } Project (#0) // { arity: 1 } - Join on=(eq(#1, #2, #3)) type=delta // { arity: 4 } + Join on=(#1 = #2 = #3) type=delta // { arity: 4 } implementation %0:l1 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:l1[#1]KAf diff --git a/test/sqllogictest/ldbc_bi.slt b/test/sqllogictest/ldbc_bi.slt index 1ea2624806e7e..497165f71249e 100644 --- a/test/sqllogictest/ldbc_bi.slt +++ b/test/sqllogictest/ldbc_bi.slt @@ -739,7 +739,7 @@ Explained Query: With cte l3 = Project (#0..=#3, #5) // { arity: 5 } - Join on=(#1{id} = #13{creatorpersonid} AND eq(#14{containerforumid}, #17{containerforumid}, #18{id})) type=differential // { arity: 19 } + Join on=(#1{id} = #13{creatorpersonid} AND #14{containerforumid} = #17{containerforumid} = #18{id}) type=differential // { arity: 19 } implementation %0:l2[#1]K » %1:message[#9]KA » %2[#0]UKA » %3[#0]UKA Get l2 // { arity: 4 } @@ -758,7 +758,7 @@ Explained Query: Get l1 // { arity: 4 } cte l1 = Project (#0..=#3) // { arity: 4 } - Join on=(eq(#1{id}, #11{id}, #12{personid})) type=delta // { arity: 13 } + Join on=(#1{id} = #11{id} = #12{personid}) type=delta // { arity: 13 } implementation %0:person » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:person[#1]KA @@ -1679,7 +1679,7 @@ Explained Query: Reduce group_by=[#0{person2id}, #1{name}] aggregates=[count(*)] // { arity: 3 } Project (#0, #9) // { arity: 2 } Filter (#7{tagid}) IS NOT NULL // { arity: 12 } - Join on=(eq(#0{person2id}, #1{id}, #2{creatorpersonid}) AND eq(#3{messageid}, #4{messageid}, #6{messageid}) AND #7{tagid} = #8{id}) type=differential // { arity: 12 } + Join on=(#0{person2id} = #1{id} = #2{creatorpersonid} AND #3{messageid} = #4{messageid} = #6{messageid} AND #7{tagid} = #8{id}) type=differential // { arity: 12 } implementation %0[#0]UKA » %1[#0]UKA » %2[#0]K » %3[#0]UKA » %4:message_hastag_tag[#1]KA » %5:tag[#0]KA ArrangeBy keys=[[#0{person2id}]] // { arity: 1 } @@ -2528,7 +2528,7 @@ Explained Query: ArrangeBy keys=[[#1, #0]] // { arity: 3 } Reduce group_by=[least(#0{person1id}, #1{person2id}), greatest(#0{person1id}, #1{person2id})] aggregates=[sum(case when (#2{parentmessageid}) IS NULL then 10 else 5 end)] // { arity: 3 } Project (#0..=#2) // { arity: 3 } - Join on=(eq(#3{containerforumid}, #4{containerforumid}, #5{id})) type=delta // { arity: 6 } + Join on=(#3{containerforumid} = #4{containerforumid} = #5{id}) type=delta // { arity: 6 } implementation %0:l1 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:l1[#3]KA @@ -2547,7 +2547,7 @@ Explained Query: ReadIndex on=forum forum_id=[*** full scan ***] // { arity: 4 } cte l1 = Project (#0, #1, #3, #4) // { arity: 4 } - Join on=(eq(#2{containerforumid}, #5{containerforumid}, #6{id})) type=delta // { arity: 7 } + Join on=(#2{containerforumid} = #5{containerforumid} = #6{id}) type=delta // { arity: 7 } implementation %0:l0 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:l0[#2]KA @@ -2821,7 +2821,7 @@ Explained Query: Get l9 // { arity: 5 } Project (#0..=#3, #16) // { arity: 5 } Map ((#4 OR #15)) // { arity: 17 } - Join on=(eq(#0, #6, #12) AND eq(#1, #7, #13) AND eq(#2, #8, #14) AND #3 = #9 AND #4 = #10 AND #5 = #11) type=differential // { arity: 16 } + Join on=(#0 = #6 = #12 AND #1 = #7 = #13 AND #2 = #8 = #14 AND #3 = #9 AND #4 = #10 AND #5 = #11) type=differential // { arity: 16 } implementation %1:l10[#0..=#5]UKKKKKK » %0:l17[#0..=#5]KKKKKK » %2[#0..=#2]KKK ArrangeBy keys=[[#0, #1, #2, #3, #4, #5]] // { arity: 6 } @@ -2952,7 +2952,7 @@ Explained Query: ArrangeBy keys=[[#1, #0]] // { arity: 3 } Reduce group_by=[least(#0{person1id}, #1{person2id}), greatest(#0{person1id}, #1{person2id})] aggregates=[sum(case when (#2{parentmessageid}) IS NULL then 10 else 5 end)] // { arity: 3 } Project (#0..=#2) // { arity: 3 } - Join on=(eq(#3{containerforumid}, #4{containerforumid}, #5{id})) type=delta // { arity: 6 } + Join on=(#3{containerforumid} = #4{containerforumid} = #5{id}) type=delta // { arity: 6 } implementation %0:l1 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:l1[#3]KA @@ -2971,7 +2971,7 @@ Explained Query: ReadIndex on=forum forum_id=[*** full scan ***] // { arity: 4 } cte l1 = Project (#0, #1, #3, #4) // { arity: 4 } - Join on=(eq(#2{containerforumid}, #5{containerforumid}, #6{id})) type=delta // { arity: 7 } + Join on=(#2{containerforumid} = #5{containerforumid} = #6{id}) type=delta // { arity: 7 } implementation %0:l0 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:l0[#2]KA @@ -3285,7 +3285,7 @@ Explained Query: cte l2 = Project (#1, #4, #6) // { arity: 3 } Filter (#2{containerforumid} != #6{containerforumid}) AND (#5{creatorpersonid} != #7{creatorpersonid}) AND ((#0{creationdate} + 12:00:00) < #3{creationdate}) // { arity: 15 } - Join on=(eq(#2{containerforumid}, #10{forumid}, #13{forumid}) AND #4{messageid} = #8{parentmessageid} AND #5{creatorpersonid} = #14{personid} AND #7{creatorpersonid} = #11{personid}) type=differential // { arity: 15 } + Join on=(#2{containerforumid} = #10{forumid} = #13{forumid} AND #4{messageid} = #8{parentmessageid} AND #5{creatorpersonid} = #14{personid} AND #7{creatorpersonid} = #11{personid}) type=differential // { arity: 15 } implementation %3:l1[#1]KA » %4:l1[#1]KA » %0:l0[#2]K » %1:l0[#2]K » %2:l0[#0, #1]KK ArrangeBy keys=[[#2{containerforumid}]] // { arity: 3 } @@ -3512,7 +3512,7 @@ Explained Query: With cte l1 = Project (#0..=#2) // { arity: 3 } - Join on=(eq(#1{id}, #3{id}, #4{id})) type=delta // { arity: 5 } + Join on=(#1{id} = #3{id} = #4{id}) type=delta // { arity: 5 } implementation %0:l0 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:l0[#1]KA @@ -3914,7 +3914,7 @@ Explained Query: Get l0 // { arity: 5 } Project (#0..=#3, #16) // { arity: 5 } Map ((#4 OR #15)) // { arity: 17 } - Join on=(eq(#0, #6, #12) AND eq(#1, #7, #13) AND eq(#2, #8, #14) AND #3 = #9 AND #4 = #10 AND #5 = #11) type=differential // { arity: 16 } + Join on=(#0 = #6 = #12 AND #1 = #7 = #13 AND #2 = #8 = #14 AND #3 = #9 AND #4 = #10 AND #5 = #11) type=differential // { arity: 16 } implementation %1:l1[#0..=#5]UKKKKKK » %0:l8[#0..=#5]KKKKKK » %2[#0..=#2]KKK ArrangeBy keys=[[#0, #1, #2, #3, #4, #5]] // { arity: 6 } @@ -4524,7 +4524,7 @@ Explained Query: Get l3 // { arity: 5 } Project (#0..=#3, #16) // { arity: 5 } Map ((#4 OR #15)) // { arity: 17 } - Join on=(eq(#0, #6, #12) AND eq(#1, #7, #13) AND eq(#2, #8, #14) AND #3 = #9 AND #4 = #10 AND #5 = #11) type=differential // { arity: 16 } + Join on=(#0 = #6 = #12 AND #1 = #7 = #13 AND #2 = #8 = #14 AND #3 = #9 AND #4 = #10 AND #5 = #11) type=differential // { arity: 16 } implementation %1:l4[#0..=#5]UKKKKKK » %0:l11[#0..=#5]KKKKKK » %2[#0..=#2]KKK ArrangeBy keys=[[#0, #1, #2, #3, #4, #5]] // { arity: 6 } diff --git a/test/sqllogictest/not-null-propagation.slt b/test/sqllogictest/not-null-propagation.slt index f3c1ea2300b17..f5fc560a7d694 100644 --- a/test/sqllogictest/not-null-propagation.slt +++ b/test/sqllogictest/not-null-propagation.slt @@ -508,7 +508,7 @@ EXPLAIN WITH(types, no_fast_path) SELECT 1 = SOME(VALUES(col_not_null), (NULL::i Explained Query: Return // { types: "(boolean?, boolean?, boolean?)" } Project (#2, #4, #2) // { types: "(boolean?, boolean?, boolean?)" } - Join on=(eq(#0, #1, #3)) type=delta // { types: "(integer, integer, boolean?, integer, boolean?)" } + Join on=(#0 = #1 = #3) type=delta // { types: "(integer, integer, boolean?, integer, boolean?)" } ArrangeBy keys=[[#0]] // { types: "(integer)" } Get l0 // { types: "(integer)" } ArrangeBy keys=[[#0]] // { types: "(integer, boolean?)" } @@ -677,7 +677,7 @@ EXPLAIN WITH(types, no_fast_path) SELECT 1 = SOME (SELECT col_not_null FROM int_ Explained Query: Return // { types: "(boolean, boolean, boolean?)" } Project (#2, #5, #7) // { types: "(boolean, boolean, boolean?)" } - Join on=(eq(#0, #3, #6) AND #1 = #4) type=differential // { types: "(integer?, integer, boolean, integer?, integer, boolean, integer?, boolean?)" } + Join on=(#0 = #3 = #6 AND #1 = #4) type=differential // { types: "(integer?, integer, boolean, integer?, integer, boolean, integer?, boolean?)" } ArrangeBy keys=[[#0]] // { types: "(integer?, integer)" } ReadStorage materialize.public.int_table // { types: "(integer?, integer)" } ArrangeBy keys=[[]] // { types: "(boolean)" } diff --git a/test/sqllogictest/scalar_subqueries_select_list.slt b/test/sqllogictest/scalar_subqueries_select_list.slt index c9630d9f0cb52..8642a5d2064ac 100644 --- a/test/sqllogictest/scalar_subqueries_select_list.slt +++ b/test/sqllogictest/scalar_subqueries_select_list.slt @@ -219,7 +219,7 @@ EXPLAIN WITH(arity, join_impls) SELECT (SELECT * FROM t1 WHERE t1.f1 = t2.f1 + 1 Explained Query: Return // { arity: 2 } Project (#2, #4) // { arity: 2 } - Join on=(eq(#0, #1, #3)) type=delta // { arity: 5 } + Join on=(#0 = #1 = #3) type=delta // { arity: 5 } implementation %0:t2 » %1[#0]KA » %2[#0]KA %1 » %0:t2[#0]KA » %2[#0]KA @@ -312,7 +312,7 @@ EXPLAIN WITH(arity, join_impls) SELECT (SELECT f1 + 1 FROM t1 WHERE t1.f1 = t2.f Explained Query: Return // { arity: 2 } Project (#2, #4) // { arity: 2 } - Join on=(eq(#0, #1, #3)) type=delta // { arity: 5 } + Join on=(#0 = #1 = #3) type=delta // { arity: 5 } implementation %0:t2 » %1[#0]KA » %2[#0]KA %1 » %0:t2[#0]KA » %2[#0]KA @@ -389,7 +389,7 @@ EXPLAIN WITH(arity, join_impls) SELECT (SELECT MIN(f1) FROM t1 WHERE t1.f1 = t2. Explained Query: Return // { arity: 2 } Project (#2, #4) // { arity: 2 } - Join on=(eq(#0, #1, #3)) type=delta // { arity: 5 } + Join on=(#0 = #1 = #3) type=delta // { arity: 5 } implementation %0:t2 » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:t2[#0]KA @@ -723,7 +723,7 @@ Explained Query: cte l1 = Project (#0) // { arity: 1 } Filter (#0) IS NOT NULL // { arity: 3 } - Join on=(eq(#0, #1, #2)) type=delta // { arity: 3 } + Join on=(#0 = #1 = #2) type=delta // { arity: 3 } implementation %0:l0 » %1:t1[#0]KA » %2:t2[#0]KA %1:t1 » %0:l0[#0]UKA » %2:t2[#0]KA diff --git a/test/sqllogictest/tpch_create_index.slt b/test/sqllogictest/tpch_create_index.slt index ecce730be5bce..2857e025b01f2 100644 --- a/test/sqllogictest/tpch_create_index.slt +++ b/test/sqllogictest/tpch_create_index.slt @@ -430,7 +430,7 @@ materialize.public.q04: Reduce group_by=[#0{o_orderpriority}] aggregates=[count(*)] // { arity: 2 } Project (#5) // { arity: 1 } Filter (#4{o_orderdate} >= 1993-07-01) AND (date_to_timestamp(#4{o_orderdate}) < 1993-10-01 00:00:00) // { arity: 11 } - Join on=(eq(#0{o_orderkey}, #9{o_orderkey}, #10{l_orderkey})) type=delta // { arity: 11 } + Join on=(#0{o_orderkey} = #9{o_orderkey} = #10{l_orderkey}) type=delta // { arity: 11 } implementation %0:orders » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:orders[#0]KAiif @@ -497,7 +497,7 @@ materialize.public.q05: Reduce group_by=[#2{n_name}] aggregates=[sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 } Project (#22, #23, #36) // { arity: 3 } Filter (#40{r_name} = "ASIA") AND (#12{o_orderdate} < 1995-01-01) AND (#12{o_orderdate} >= 1994-01-01) AND (#0{c_custkey}) IS NOT NULL AND (#3{c_nationkey}) IS NOT NULL AND (#8{o_orderkey}) IS NOT NULL AND (#37{n_regionkey}) IS NOT NULL // { arity: 42 } - Join on=(#0{c_custkey} = #9{o_custkey} AND eq(#3{c_nationkey}, #34{s_nationkey}, #35{n_nationkey}) AND #8{o_orderkey} = #17{l_orderkey} AND #19{l_suppkey} = #33{s_suppkey} AND #37{n_regionkey} = #39{r_regionkey}) type=differential // { arity: 42 } + Join on=(#0{c_custkey} = #9{o_custkey} AND #3{c_nationkey} = #34{s_nationkey} = #35{n_nationkey} AND #8{o_orderkey} = #17{l_orderkey} AND #19{l_suppkey} = #33{s_suppkey} AND #37{n_regionkey} = #39{r_regionkey}) type=differential // { arity: 42 } implementation %5:region[#0]KAef » %4:nation[#2]KAef » %0:customer[#3]KAef » %1:orders[#1]KAeiif » %2:lineitem[#0]KAeiif » %3:supplier[#0, #1]KKeiif ArrangeBy keys=[[#3{c_nationkey}]] // { arity: 8 } @@ -821,7 +821,7 @@ materialize.public.q09: 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 } Project (#20..=#22, #35, #41, #47) // { arity: 6 } Filter (#0{p_partkey}) IS NOT NULL AND (#9{s_suppkey}) IS NOT NULL AND (#12{s_nationkey}) IS NOT NULL AND (#16{l_orderkey}) IS NOT NULL AND like["%green%"](varchar_to_text(#1{p_name})) // { arity: 50 } - Join on=(eq(#0{p_partkey}, #17{l_partkey}, #32{ps_partkey}) AND eq(#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 } + 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 } implementation %0:part » %2:lineitem[#1]KA » %3:partsupp[#0, #1]KKA » %1:supplier[#0]KA » %4:orders[#0]KA » %5:nation[#0]KA %1:supplier » %2:lineitem[#2]KA » %3:partsupp[#0, #1]KKA » %0:part[#0]KAlf » %4:orders[#0]KA » %5:nation[#0]KA diff --git a/test/sqllogictest/tpch_create_materialized_view.slt b/test/sqllogictest/tpch_create_materialized_view.slt index 1c843771f48c2..32096c91fec76 100644 --- a/test/sqllogictest/tpch_create_materialized_view.slt +++ b/test/sqllogictest/tpch_create_materialized_view.slt @@ -396,7 +396,7 @@ materialize.public.q04: Reduce group_by=[#0{o_orderpriority}] aggregates=[count(*)] // { arity: 2 } Project (#5) // { arity: 1 } Filter (#4{o_orderdate} >= 1993-07-01) AND (date_to_timestamp(#4{o_orderdate}) < 1993-10-01 00:00:00) // { arity: 11 } - Join on=(eq(#0{o_orderkey}, #9{o_orderkey}, #10{l_orderkey})) type=delta // { arity: 11 } + Join on=(#0{o_orderkey} = #9{o_orderkey} = #10{l_orderkey}) type=delta // { arity: 11 } implementation %0:orders » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:orders[#0]KAiif @@ -454,7 +454,7 @@ materialize.public.q05: Reduce group_by=[#2{n_name}] aggregates=[sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 } Project (#22, #23, #36) // { arity: 3 } Filter (#40{r_name} = "ASIA") AND (#12{o_orderdate} < 1995-01-01) AND (#12{o_orderdate} >= 1994-01-01) AND (#0{c_custkey}) IS NOT NULL AND (#3{c_nationkey}) IS NOT NULL AND (#8{o_orderkey}) IS NOT NULL AND (#37{n_regionkey}) IS NOT NULL // { arity: 42 } - Join on=(#0{c_custkey} = #9{o_custkey} AND eq(#3{c_nationkey}, #34{s_nationkey}, #35{n_nationkey}) AND #8{o_orderkey} = #17{l_orderkey} AND #19{l_suppkey} = #33{s_suppkey} AND #37{n_regionkey} = #39{r_regionkey}) type=differential // { arity: 42 } + Join on=(#0{c_custkey} = #9{o_custkey} AND #3{c_nationkey} = #34{s_nationkey} = #35{n_nationkey} AND #8{o_orderkey} = #17{l_orderkey} AND #19{l_suppkey} = #33{s_suppkey} AND #37{n_regionkey} = #39{r_regionkey}) type=differential // { arity: 42 } implementation %5:region[#0]KAef » %4:nation[#2]KAef » %0:customer[#3]KAef » %1:orders[#1]KAeiif » %2:lineitem[#0]KAeiif » %3:supplier[#0, #1]KKeiif ArrangeBy keys=[[#3{c_nationkey}]] // { arity: 8 } @@ -742,7 +742,7 @@ materialize.public.q09: 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 } Project (#20..=#22, #35, #41, #47) // { arity: 6 } Filter (#0{p_partkey}) IS NOT NULL AND (#9{s_suppkey}) IS NOT NULL AND (#12{s_nationkey}) IS NOT NULL AND (#16{l_orderkey}) IS NOT NULL AND like["%green%"](varchar_to_text(#1{p_name})) // { arity: 50 } - Join on=(eq(#0{p_partkey}, #17{l_partkey}, #32{ps_partkey}) AND eq(#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 } + 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 } implementation %0:part » %2:lineitem[#1]KA » %3:partsupp[#0, #1]KKA » %1:supplier[#0]KA » %4:orders[#0]KA » %5:nation[#0]KA %1:supplier » %2:lineitem[#2]KA » %3:partsupp[#0, #1]KKA » %0:part[#0]KAlf » %4:orders[#0]KA » %5:nation[#0]KA diff --git a/test/sqllogictest/tpch_select.slt b/test/sqllogictest/tpch_select.slt index f8d9f1a1c3eef..9af48cf8926f3 100644 --- a/test/sqllogictest/tpch_select.slt +++ b/test/sqllogictest/tpch_select.slt @@ -395,7 +395,7 @@ Explained Query: Reduce group_by=[#0{o_orderpriority}] aggregates=[count(*)] // { arity: 2 } Project (#5) // { arity: 1 } Filter (#4{o_orderdate} >= 1993-07-01) AND (date_to_timestamp(#4{o_orderdate}) < 1993-10-01 00:00:00) // { arity: 11 } - Join on=(eq(#0{o_orderkey}, #9{o_orderkey}, #10{l_orderkey})) type=delta // { arity: 11 } + Join on=(#0{o_orderkey} = #9{o_orderkey} = #10{l_orderkey}) type=delta // { arity: 11 } implementation %0:orders » %1[#0]UKA » %2[#0]UKA %1 » %2[#0]UKA » %0:orders[#0]KAiif @@ -453,7 +453,7 @@ Explained Query: Reduce group_by=[#2{n_name}] aggregates=[sum((#0{l_extendedprice} * (1 - #1{l_discount})))] // { arity: 2 } Project (#22, #23, #36) // { arity: 3 } Filter (#40{r_name} = "ASIA") AND (#12{o_orderdate} < 1995-01-01) AND (#12{o_orderdate} >= 1994-01-01) AND (#0{c_custkey}) IS NOT NULL AND (#3{c_nationkey}) IS NOT NULL AND (#8{o_orderkey}) IS NOT NULL AND (#37{n_regionkey}) IS NOT NULL // { arity: 42 } - Join on=(#0{c_custkey} = #9{o_custkey} AND eq(#3{c_nationkey}, #34{s_nationkey}, #35{n_nationkey}) AND #8{o_orderkey} = #17{l_orderkey} AND #19{l_suppkey} = #33{s_suppkey} AND #37{n_regionkey} = #39{r_regionkey}) type=differential // { arity: 42 } + Join on=(#0{c_custkey} = #9{o_custkey} AND #3{c_nationkey} = #34{s_nationkey} = #35{n_nationkey} AND #8{o_orderkey} = #17{l_orderkey} AND #19{l_suppkey} = #33{s_suppkey} AND #37{n_regionkey} = #39{r_regionkey}) type=differential // { arity: 42 } implementation %5:region[#0]KAef » %4:nation[#2]KAef » %0:customer[#3]KAef » %1:orders[#1]KAeiif » %2:lineitem[#0]KAeiif » %3:supplier[#0, #1]KKeiif ArrangeBy keys=[[#3{c_nationkey}]] // { arity: 8 } @@ -740,7 +740,7 @@ Explained Query: 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 } Project (#20..=#22, #35, #41, #47) // { arity: 6 } Filter (#0{p_partkey}) IS NOT NULL AND (#9{s_suppkey}) IS NOT NULL AND (#12{s_nationkey}) IS NOT NULL AND (#16{l_orderkey}) IS NOT NULL AND like["%green%"](varchar_to_text(#1{p_name})) // { arity: 50 } - Join on=(eq(#0{p_partkey}, #17{l_partkey}, #32{ps_partkey}) AND eq(#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 } + 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 } implementation %0:part » %2:lineitem[#1]KA » %3:partsupp[#0, #1]KKA » %1:supplier[#0]KA » %4:orders[#0]KA » %5:nation[#0]KA %1:supplier » %2:lineitem[#2]KA » %3:partsupp[#0, #1]KKA » %0:part[#0]KAlf » %4:orders[#0]KA » %5:nation[#0]KA diff --git a/test/sqllogictest/transform/join_index.slt b/test/sqllogictest/transform/join_index.slt index 0752b2fefa425..44d220f24736d 100644 --- a/test/sqllogictest/transform/join_index.slt +++ b/test/sqllogictest/transform/join_index.slt @@ -350,7 +350,7 @@ and bar.b - foo.b = foo.a / bar.a ---- Explained Query: Project (#1, #3) // { arity: 2 } - Join on=(eq(-1, (#3 - #1), (#0 / #2))) type=differential // { arity: 4 } + Join on=(-1 = (#3 - #1) = (#0 / #2)) type=differential // { arity: 4 } implementation %0:foo[×] » %1:bar[×] ArrangeBy keys=[[]] // { arity: 2 } @@ -599,7 +599,7 @@ t3.x != t3.y AND Explained Query: Project (#0..=#14, #0, #16..=#29, #0, #31..=#44, #0, #46..=#59, #0, #61..=#74, #0, #76..=#89, #0, #91..=#104, #0, #106..=#119, #0, #121..=#134, #0, #136..=#149, #0, #151..=#153) // { arity: 154 } Filter (#109) IS NULL AND like["a%"](#125) AND (#137 = 71) AND (#95 <= 8) AND (#81 > 5) AND (#95 >= 3) AND NOT(like["b%"](#69)) AND (#39 != #40) AND (#53 != #54) // { arity: 154 } - Join on=(eq(#0, #15, #30, #45, #60, #75, #90, #105, #120, #135, #150)) type=delta // { arity: 154 } + Join on=(#0 = #15 = #30 = #45 = #60 = #75 = #90 = #105 = #120 = #135 = #150) type=delta // { arity: 154 } implementation %0:big » %9:big[#9]KAef » %8:big[#8]KAlf » %7:big[#7]KAnf » %6:big[#6]KAiif » %5:big[#5]KAif » %2:big[#2]KAf » %3:big[#3]KAf » %4:big[#4]KAf » %1:big[#1]KA » %10:big[#10]KA %1:big » %9:big[#9]KAef » %8:big[#8]KAlf » %7:big[#7]KAnf » %6:big[#6]KAiif » %5:big[#5]KAif » %2:big[#2]KAf » %3:big[#3]KAf » %4:big[#4]KAf » %0:big[#0]KA » %10:big[#10]KA @@ -665,7 +665,7 @@ t0.s LIKE 'a%' Explained Query: Project (#0..=#14, #0, #16..=#27, #29, #30, #0, #32..=#42) // { arity: 42 } Filter like["a%"](#13) // { arity: 43 } - Join on=(eq(#0, #15, #31)) type=delta // { arity: 43 } + Join on=(#0 = #15 = #31) type=delta // { arity: 43 } implementation %0:big » %1:big[#1]KAe » %2:big[#2]KA %1:big » %0:big[#0]KAlf » %2:big[#2]KA diff --git a/test/sqllogictest/transform/relation_cse.slt b/test/sqllogictest/transform/relation_cse.slt index 29ab32ed28b1b..328e51215b127 100644 --- a/test/sqllogictest/transform/relation_cse.slt +++ b/test/sqllogictest/transform/relation_cse.slt @@ -1564,7 +1564,7 @@ Explained Query: Return // { arity: 2 } Return // { arity: 2 } Project (#0, #3) // { arity: 2 } - Join on=(eq(#0, #1, #2)) type=delta // { arity: 4 } + Join on=(#0 = #1 = #2) type=delta // { arity: 4 } implementation %0 » %1:l3[#0]UKA » %2[#0]KA %1:l3 » %0[#0]UKA » %2[#0]KA