You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2026/03/31 21:13:54 UTC
(impala) branch master updated: IMPALA-14436: Calcite planner: Fix min/max runtime filters
This is an automated email from the ASF dual-hosted git repository.
michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new 612a4b63f IMPALA-14436: Calcite planner: Fix min/max runtime filters
612a4b63f is described below
commit 612a4b63fc091faa143cb5f90ad459b983bb7a86
Author: Steve Carlin <sc...@cloudera.com>
AuthorDate: Fri Sep 12 17:18:32 2025 -0700
IMPALA-14436: Calcite planner: Fix min/max runtime filters
This patch fixes an issue where min/max runtime filters were not getting
created for nested loop joins. The conjuncts need to be placed in
the right variables when initializing the NestedLoopJoinNode.
For inner joins, all the conjuncts need to be in the filterConjuncts
in order to be processed for the min/max runtime filter.
This patch is needed to allow overlap_min_max_filters.test to succeed
for the Calcite planner.
An extra minor fix has been thrown into the patch: When the conjunct
is "IS NOT DISCTINCT FROM", this should be treated as an equi-join
conjunct.
Change-Id: I4e5f9be67a775a771c0868ac4407410385e8a755
Reviewed-on: http://gerrit.cloudera.org:8080/23912
Reviewed-by: Michael Smith <mi...@cloudera.com>
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
.../impala/calcite/rel/node/ImpalaAggRel.java | 7 ++
.../impala/calcite/rel/node/ImpalaJoinRel.java | 99 ++++++++++++++--------
.../calcite/rel/phys/ImpalaNestedLoopJoinNode.java | 5 +-
.../PlannerTest/calcite_tpcds/tpcds-q14a.test | 18 ++--
.../PlannerTest/calcite_tpcds/tpcds-q14b.test | 12 +--
.../PlannerTest/calcite_tpcds/tpcds-q23a.test | 12 +--
.../PlannerTest/calcite_tpcds/tpcds-q23b.test | 12 +--
.../PlannerTest/calcite_tpcds/tpcds-q24a.test | 6 +-
.../PlannerTest/calcite_tpcds/tpcds-q24b.test | 6 +-
.../PlannerTest/calcite_tpcds/tpcds-q44.test | 12 +--
.../PlannerTest/calcite_tpcds/tpcds-q54.test | 12 +--
11 files changed, 119 insertions(+), 82 deletions(-)
diff --git a/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAggRel.java b/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAggRel.java
index d0c3e7925..59477dcce 100644
--- a/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAggRel.java
+++ b/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAggRel.java
@@ -148,6 +148,9 @@ public class ImpalaAggRel extends Aggregate
simplifiedAnalyzer.setUnassignedConjuncts(converter.getImpalaConjuncts());
}
aggNode.init(simplifiedAnalyzer);
+ if (returnsSingleRow(this)) {
+ ((AggregationNode) aggNode).setIsNonCorrelatedScalarSubquery(true);
+ }
simplifiedAnalyzer.clearUnassignedConjuncts();
return new NodeWithExprs(aggNode, outputExprs, getRowType().getFieldNames());
@@ -446,6 +449,10 @@ public class ImpalaAggRel extends Aggregate
return builder.build();
}
+ public static boolean returnsSingleRow(Aggregate agg) {
+ return agg.getGroupCount() == 0 && agg.getAggCallList().size() == 1;
+ }
+
@Override
public RelNodeType relNodeType() {
return RelNodeType.AGGREGATE;
diff --git a/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaJoinRel.java b/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaJoinRel.java
index 05772f391..116f405e3 100644
--- a/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaJoinRel.java
+++ b/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaJoinRel.java
@@ -35,6 +35,7 @@ import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.impala.analysis.Analyzer;
import org.apache.impala.analysis.BinaryPredicate;
+import org.apache.impala.analysis.ExprSubstitutionMap;
import org.apache.impala.analysis.Expr;
import org.apache.impala.analysis.JoinOperator;
import org.apache.impala.analysis.SlotRef;
@@ -62,6 +63,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -102,35 +104,51 @@ public class ImpalaJoinRel extends Join
Analyzer analyzer = context.ctx_.getRootAnalyzer();
JoinOperator joinOp = getImpalaJoinOp();
- List<BinaryPredicate> equiJoinConjuncts = new ArrayList<>();
- List<Expr> otherJoinConjuncts = new ArrayList<>();
// IMPALA-13176: TODO: Impala allows forcing hints for the distribution mode
// - e.g force broadcast or hash partition join. However, we are not
// currently supporting hints from the new planner.
JoinNode.DistributionMode distMode = JoinNode.DistributionMode.NONE;
+ List<ConjunctInfo> conjunctInfos = getConditionConjuncts(getCondition(),
+ leftInput, rightInput, analyzer);
+
+ List<BinaryPredicate> equiJoinConjuncts =
+ conjunctInfos.stream()
+ .filter(conj -> conj.isEquiJoin_)
+ .map(conj -> (BinaryPredicate) conj.conjunct_)
+ .collect(Collectors.toList());
+
+ List<Expr> nonEquiJoinConjuncts =
+ conjunctInfos.stream()
+ .filter(conj -> !conj.isEquiJoin_)
+ .map(conj -> conj.conjunct_)
+ .collect(Collectors.toList());
+
+ boolean isHashJoin = equiJoinConjuncts.size() > 0;
+
+ List<Expr> otherJoinConjuncts = new ArrayList<>();
+ List<Expr> filterConjuncts = new ArrayList<>();
+
+ if (isHashJoin) {
+ otherJoinConjuncts.addAll(nonEquiJoinConjuncts);
+ } else {
+ // For nested loop joins, the conjuncts only need to be separated when it is
+ // not an inner join.
+ if (getJoinType().equals(JoinRelType.INNER)) {
+ filterConjuncts.addAll(nonEquiJoinConjuncts);
+ } else {
+ otherJoinConjuncts.addAll(nonEquiJoinConjuncts);
+ }
+ }
+
// get the Exprs from both sides. If it's an outer join, some of the
// Exprs will be Null wrapped (see comment on method)
List<Expr> outputExprs = new ArrayList<>();
outputExprs.addAll(getOutputExprs(analyzer, leftInput, true, joinOp));
outputExprs.addAll(getOutputExprs(analyzer, rightInput, false, joinOp));
- // Populate equijoin and non-equijoin conditions
- if (!getCondition().isAlwaysTrue()) {
- List<ConjunctInfo> conjunctInfos = getConditionConjuncts(getCondition(),
- leftInput, rightInput, analyzer);
- for (ConjunctInfo conjunctInfo : conjunctInfos) {
- if (conjunctInfo.isEquiJoin_) {
- equiJoinConjuncts.add((BinaryPredicate) conjunctInfo.conjunct_);
- } else {
- otherJoinConjuncts.add(conjunctInfo.conjunct_);
- }
- }
- }
-
- // Populate filter condition
- List<Expr> filterConjuncts = new ArrayList<>();
+ // Populate filter condition if it existed in a parent RelNode.
if (context.filterCondition_ != null) {
ExprConjunctsConverter converter = new ExprConjunctsConverter(
context.filterCondition_, outputExprs, getCluster().getRexBuilder(), analyzer);
@@ -138,23 +156,22 @@ public class ImpalaJoinRel extends Join
}
// Create Impala plan node
- PlanNode joinNode = equiJoinConjuncts.size() == 0
- ? new ImpalaNestedLoopJoinNode(context.ctx_.getNextNodeId(), leftInput.planNode_,
+ PlanNode joinNode = isHashJoin
+ ? new ImpalaHashJoinNode(context.ctx_.getNextNodeId(), leftInput.planNode_,
rightInput.planNode_, isStraightJoin(), distMode, joinOp,
- otherJoinConjuncts, filterConjuncts, analyzer)
- : new ImpalaHashJoinNode(context.ctx_.getNextNodeId(), leftInput.planNode_,
+ equiJoinConjuncts, otherJoinConjuncts, filterConjuncts, analyzer)
+ : new ImpalaNestedLoopJoinNode(context.ctx_.getNextNodeId(), leftInput.planNode_,
rightInput.planNode_, isStraightJoin(), distMode, joinOp,
- equiJoinConjuncts, otherJoinConjuncts, filterConjuncts, analyzer);
+ otherJoinConjuncts, filterConjuncts, analyzer);
- // register the equi join conjuncts with the analyzer such that
- // value transfer graph creation can consume it. It is only useful
- // in the value transfer graph if the value transfer is equal on
- // both sides.
- if (equiJoinConjuncts.size() > 0) {
- List<Expr> equiJoinExprs = new ArrayList<Expr>(equiJoinConjuncts);
- registerConjuncts(getJoinConjunctListToRegister(equiJoinExprs), analyzer,
- joinNode);
- }
+ // register all the conjuncts.
+ List<Expr> exprsToRegister = new ArrayList<Expr>(equiJoinConjuncts);
+ exprsToRegister.addAll(filterConjuncts);
+ exprsToRegister.addAll(otherJoinConjuncts);
+ registerConjuncts(getJoinConjunctListToRegister(exprsToRegister), analyzer,
+ joinNode, joinOp);
+
+ joinNode.setOutputSmap(new ExprSubstitutionMap());
return new NodeWithExprs(joinNode, outputExprs, getRowType().getFieldNames());
}
@@ -249,7 +266,8 @@ public class ImpalaJoinRel extends Join
return retExpr;
}
- private JoinOperator getImpalaJoinOp() throws ImpalaException {
+ private JoinOperator getImpalaJoinOp()
+ throws ImpalaException {
switch (getJoinType()) {
case INNER:
return JoinOperator.INNER_JOIN;
@@ -330,7 +348,9 @@ public class ImpalaJoinRel extends Join
* of the join conjunct expression.
*/
public List<Expr> getJoinConjunctToRegister(Expr joinConjunct) {
- Preconditions.checkState(joinConjunct.getChildren().size() == 2);
+ if (joinConjunct.getChildren().size() != 2) {
+ return Lists.newArrayList();
+ }
List<SlotRef> leftSideSlotRefs = new ArrayList<>();
List<SlotRef> rightSideSlotRefs = new ArrayList<>();
joinConjunct.getChild(0).collect(SlotRef.class, leftSideSlotRefs);
@@ -422,6 +442,11 @@ public class ImpalaJoinRel extends Join
throws ImpalaException {
List<ConjunctInfo> conjunctInfos = new ArrayList<>();
+ // isAlwaysTrue() means there's no condition to add
+ if (condition.isAlwaysTrue()) {
+ return conjunctInfos;
+ }
+
CreateExprVisitor visitor = new CreateExprVisitor(getCluster().getRexBuilder(),
getAllInputExprs(leftInput, rightInput), analyzer);
@@ -447,7 +472,7 @@ public class ImpalaJoinRel extends Join
// - should be at least one input ref on the left side and one input ref on
// the right side.
private boolean isEquijoinConjunct(RexNode conjunct, NodeWithExprs leftInput) {
- if (!conjunct.isA(SqlKind.EQUALS)) {
+ if (!conjunct.isA(SqlKind.EQUALS) && !conjunct.isA(SqlKind.IS_NOT_DISTINCT_FROM)) {
return false;
}
@@ -487,9 +512,11 @@ public class ImpalaJoinRel extends Join
* valueTransfersGraph to determine if runtime filters can be created.
*/
private void registerConjuncts(List<Expr> equiJoinExprs, Analyzer analyzer,
- PlanNode joinNode) throws ImpalaException {
+ PlanNode joinNode, JoinOperator joinOp) throws ImpalaException {
+ if (equiJoinExprs.size() == 0) {
+ return;
+ }
- JoinOperator joinOp = getImpalaJoinOp();
if (joinOp == JoinOperator.RIGHT_OUTER_JOIN) {
List<TableRef> lhsTableRefs = getTableRefs(joinNode.getChild(0));
registerOuterJoinedTids(lhsTableRefs, analyzer, joinOp);
diff --git a/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/phys/ImpalaNestedLoopJoinNode.java b/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/phys/ImpalaNestedLoopJoinNode.java
index b177878fb..e1bf66d17 100644
--- a/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/phys/ImpalaNestedLoopJoinNode.java
+++ b/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/phys/ImpalaNestedLoopJoinNode.java
@@ -42,8 +42,11 @@ public class ImpalaNestedLoopJoinNode extends NestedLoopJoinNode {
List<Expr> filterConjuncts, Analyzer analyzer) throws ImpalaException {
super(leftInput, rightInput, isStraightJoin, distMode, joinOp, joinConjuncts);
setId(id);
- init(analyzer);
+ for (Expr conjunct : filterConjuncts) {
+ conjunct.analyze(analyzer);
+ }
this.conjuncts_ = filterConjuncts;
+ init(analyzer);
}
@Override
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14a.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14a.test
index c64ab47b9..4c10f0100 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14a.test
@@ -151,7 +151,7 @@ PLAN-ROOT SINK
| in pipelines: 32(GETNEXT), 76(GETNEXT), 120(GETNEXT)
|
|--133:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.web_sales_3.ws_quantity, tpcds_partitioned_parquet_snap.web_sales_3.ws_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.web_sales_3.ws_quantity, tpcds_partitioned_parquet_snap.web_sales_3.ws_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | tuple-ids=134,150 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 120(GETNEXT), 132(OPEN)
@@ -582,7 +582,7 @@ PLAN-ROOT SINK
| in pipelines: 32(GETNEXT), 76(GETNEXT)
|
|--89:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.catalog_sales_1.cs_quantity, tpcds_partitioned_parquet_snap.catalog_sales_1.cs_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.catalog_sales_1.cs_quantity, tpcds_partitioned_parquet_snap.catalog_sales_1.cs_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | tuple-ids=83,99 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 76(GETNEXT), 88(OPEN)
@@ -1008,7 +1008,7 @@ PLAN-ROOT SINK
| in pipelines: 46(GETNEXT)
|
45:NESTED LOOP JOIN [INNER JOIN]
-| join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| mem-estimate=16B mem-reservation=0B thread-reservation=0
| tuple-ids=33,49 row-size=52B cardinality=14.91K cost=3055
| in pipelines: 32(GETNEXT), 44(OPEN)
@@ -1521,7 +1521,7 @@ max-parallelism=108 segment-costs=[31467972, 31467972, 31442780, 1151027, 322888
|
|--133:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 08
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.web_sales_3.ws_quantity, tpcds_partitioned_parquet_snap.web_sales_3.ws_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.web_sales_3.ws_quantity, tpcds_partitioned_parquet_snap.web_sales_3.ws_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=134,150 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 214(GETNEXT), 219(OPEN)
@@ -2294,7 +2294,7 @@ max-parallelism=108 segment-costs=[31467972, 31467972, 31442780, 1151027, 322888
|
|--89:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 04
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.catalog_sales_1.cs_quantity, tpcds_partitioned_parquet_snap.catalog_sales_1.cs_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.catalog_sales_1.cs_quantity, tpcds_partitioned_parquet_snap.catalog_sales_1.cs_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=83,99 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 186(GETNEXT), 191(OPEN)
@@ -3062,7 +3062,7 @@ max-parallelism=108 segment-costs=[31467972, 31467972, 31442780, 1151027, 322888
|
45:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 00
-| join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=33,49 row-size=52B cardinality=14.91K cost=3055
| in pipelines: 158(GETNEXT), 163(OPEN)
@@ -3916,7 +3916,7 @@ max-parallelism=108 segment-costs=[31467972, 31467972, 31442780, 1151027, 322888
|
|--133:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 08
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.web_sales_3.ws_quantity, tpcds_partitioned_parquet_snap.web_sales_3.ws_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.web_sales_3.ws_quantity, tpcds_partitioned_parquet_snap.web_sales_3.ws_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=134,150 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 214(GETNEXT), 219(OPEN)
@@ -4689,7 +4689,7 @@ max-parallelism=108 segment-costs=[31467972, 31467972, 31442780, 1151027, 322888
|
|--89:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 04
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.catalog_sales_1.cs_quantity, tpcds_partitioned_parquet_snap.catalog_sales_1.cs_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.catalog_sales_1.cs_quantity, tpcds_partitioned_parquet_snap.catalog_sales_1.cs_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=83,99 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 186(GETNEXT), 191(OPEN)
@@ -5457,7 +5457,7 @@ max-parallelism=108 segment-costs=[31467972, 31467972, 31442780, 1151027, 322888
|
45:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 00
-| join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=33,49 row-size=52B cardinality=14.91K cost=3055
| in pipelines: 158(GETNEXT), 163(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14b.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14b.test
index 53fe911bf..4ff12d036 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14b.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q14b.test
@@ -132,7 +132,7 @@ PLAN-ROOT SINK
| in pipelines: 34(GETNEXT), 82(OPEN)
|
|--95:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | tuple-ids=89,105 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 82(GETNEXT), 94(OPEN)
@@ -593,7 +593,7 @@ PLAN-ROOT SINK
| in pipelines: 49(GETNEXT)
|
47:NESTED LOOP JOIN [INNER JOIN]
-| join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| mem-estimate=16B mem-reservation=0B thread-reservation=0
| tuple-ids=36,52 row-size=52B cardinality=14.91K cost=3055
| in pipelines: 34(GETNEXT), 46(OPEN)
@@ -1098,7 +1098,7 @@ max-parallelism=8 segment-costs=[26171763, 73981498, 220] cpu-comparison-result=
| |
| 95:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 01
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=89,105 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 155(GETNEXT), 160(OPEN)
@@ -1942,7 +1942,7 @@ max-parallelism=8 segment-costs=[26171763, 73981498, 220] cpu-comparison-result=
|
47:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 16
-| join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=36,52 row-size=52B cardinality=14.91K cost=3055
| in pipelines: 123(GETNEXT), 128(OPEN)
@@ -2829,7 +2829,7 @@ max-parallelism=8 segment-costs=[26171763, 73981498, 220] cpu-comparison-result=
| |
| 95:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 01
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=89,105 row-size=52B cardinality=14.91K cost=3055
| | in pipelines: 155(GETNEXT), 160(OPEN)
@@ -3673,7 +3673,7 @@ max-parallelism=8 segment-costs=[26171763, 73981498, 220] cpu-comparison-result=
|
47:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 16
-| join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
+| predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales.ss_quantity, tpcds_partitioned_parquet_snap.store_sales.ss_list_price)) > CAST(avg(multiply(QUANTITY, LIST_PRICE)) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=36,52 row-size=52B cardinality=14.91K cost=3055
| in pipelines: 123(GETNEXT), 128(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23a.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23a.test
index 9bc196f67..697f732b8 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23a.test
@@ -80,7 +80,7 @@ PLAN-ROOT SINK
| | in pipelines: 37(GETNEXT), 28(OPEN)
| |
| |--36:NESTED LOOP JOIN [INNER JOIN]
-| | | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
+| | | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
| | | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | | tuple-ids=29,37 row-size=36B cardinality=3.00M cost=614700
| | | in pipelines: 28(GETNEXT), 35(OPEN)
@@ -320,7 +320,7 @@ PLAN-ROOT SINK
| in pipelines: 01(GETNEXT), 15(OPEN)
|
|--23:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
| | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | tuple-ids=16,24 row-size=36B cardinality=3.00M cost=614700
| | in pipelines: 15(GETNEXT), 22(OPEN)
@@ -614,7 +614,7 @@ max-parallelism=70 segment-costs=[607053325, 185] cpu-comparison-result=742 [max
| | max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| | 36:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | | join table id: 10
-| | | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
+| | | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=29,37 row-size=36B cardinality=3.00M cost=614700
| | | in pipelines: 79(GETNEXT), 85(OPEN)
@@ -1081,7 +1081,7 @@ max-parallelism=70 segment-costs=[607053325, 185] cpu-comparison-result=742 [max
| max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| 23:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 01
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=16,24 row-size=36B cardinality=3.00M cost=614700
| | in pipelines: 60(GETNEXT), 66(OPEN)
@@ -1585,7 +1585,7 @@ max-parallelism=70 segment-costs=[607053325, 185] cpu-comparison-result=742 [max
| | max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| | 36:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | | join table id: 10
-| | | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
+| | | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=29,37 row-size=36B cardinality=3.00M cost=614700
| | | in pipelines: 79(GETNEXT), 85(OPEN)
@@ -2052,7 +2052,7 @@ max-parallelism=70 segment-costs=[607053325, 185] cpu-comparison-result=742 [max
| max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| 23:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 01
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=16,24 row-size=36B cardinality=3.00M cost=614700
| | in pipelines: 60(GETNEXT), 66(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23b.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23b.test
index 5feb4ec16..81de39497 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23b.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23b.test
@@ -114,7 +114,7 @@ PLAN-ROOT SINK
| | in pipelines: 40(GETNEXT), 31(OPEN)
| |
| |--39:NESTED LOOP JOIN [INNER JOIN]
-| | | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
+| | | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
| | | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | | tuple-ids=32,40 row-size=36B cardinality=3.00M cost=614700
| | | in pipelines: 31(GETNEXT), 38(OPEN)
@@ -382,7 +382,7 @@ PLAN-ROOT SINK
| in pipelines: 01(GETNEXT), 15(OPEN)
|
|--23:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
| | mem-estimate=16B mem-reservation=0B thread-reservation=0
| | tuple-ids=16,24 row-size=36B cardinality=3.00M cost=614700
| | in pipelines: 15(GETNEXT), 22(OPEN)
@@ -740,7 +740,7 @@ max-parallelism=80 segment-costs=[132860130, 312127551, 664294957, 136] cpu-comp
| | max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| | 39:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | | join table id: 12
-| | | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
+| | | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=32,40 row-size=36B cardinality=3.00M cost=614700
| | | in pipelines: 89(GETNEXT), 95(OPEN)
@@ -1276,7 +1276,7 @@ max-parallelism=60 segment-costs=[543918846]
| max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| 23:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 02
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=16,24 row-size=36B cardinality=3.00M cost=614700
| | in pipelines: 66(GETNEXT), 72(OPEN)
@@ -1844,7 +1844,7 @@ max-parallelism=80 segment-costs=[132860130, 312127551, 664294957, 136] cpu-comp
| | max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| | 39:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | | join table id: 12
-| | | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
+| | | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_2.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_2.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_3.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_3.ss_sales_price)))) AS DECIMAL(38,2))
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=32,40 row-size=36B cardinality=3.00M cost=614700
| | | in pipelines: 89(GETNEXT), 95(OPEN)
@@ -2380,7 +2380,7 @@ max-parallelism=60 segment-costs=[543918846]
| max-parallelism=170 segment-costs=[1644760041, 1035900] cpu-comparison-result=240 [max(40 (self) vs 240 (sum children))]
| 23:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 02
-| | join predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
+| | predicates: sum(multiply(tpcds_partitioned_parquet_snap.store_sales_0.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_0.ss_sales_price)) > CAST(multiply(CAST(0.950000 AS DECIMAL(10,6)), max(sum(multiply(tpcds_partitioned_parquet_snap.store_sales_1.ss_quantity, tpcds_partitioned_parquet_snap.store_sales_1.ss_sales_price)))) AS DECIMAL(38,2))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=16,24 row-size=36B cardinality=3.00M cost=614700
| | in pipelines: 66(GETNEXT), 72(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24a.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24a.test
index d6bd4df49..3ce2622cc 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24a.test
@@ -69,7 +69,7 @@ PLAN-ROOT SINK
| in pipelines: 27(GETNEXT), 12(OPEN)
|
26:NESTED LOOP JOIN [INNER JOIN]
-| join predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
+| predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
| mem-estimate=16B mem-reservation=0B thread-reservation=0
| tuple-ids=13,28 row-size=84B cardinality=79.62K cost=16314
| in pipelines: 12(GETNEXT), 25(OPEN)
@@ -370,7 +370,7 @@ max-parallelism=10 segment-costs=[5036796, 283918, 166680] cpu-comparison-result
|
26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 00
-| join predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
+| predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=13,28 row-size=84B cardinality=79.62K cost=16314
| in pipelines: 37(GETNEXT), 47(OPEN)
@@ -938,7 +938,7 @@ max-parallelism=10 segment-costs=[5036796, 283918, 166680] cpu-comparison-result
|
26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 00
-| join predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
+| predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=13,28 row-size=84B cardinality=79.62K cost=16314
| in pipelines: 37(GETNEXT), 47(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24b.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24b.test
index d145ddc4c..d71ddd33d 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24b.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q24b.test
@@ -70,7 +70,7 @@ PLAN-ROOT SINK
| in pipelines: 27(GETNEXT), 12(OPEN)
|
26:NESTED LOOP JOIN [INNER JOIN]
-| join predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
+| predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
| mem-estimate=16B mem-reservation=0B thread-reservation=0
| tuple-ids=13,28 row-size=84B cardinality=79.62K cost=16314
| in pipelines: 12(GETNEXT), 25(OPEN)
@@ -371,7 +371,7 @@ max-parallelism=10 segment-costs=[5036796, 283918, 166680] cpu-comparison-result
|
26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 00
-| join predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
+| predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=13,28 row-size=84B cardinality=79.62K cost=16314
| in pipelines: 37(GETNEXT), 47(OPEN)
@@ -939,7 +939,7 @@ max-parallelism=10 segment-costs=[5036796, 283918, 166680] cpu-comparison-result
|
26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| join table id: 00
-| join predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
+| predicates: sum(sum(tpcds_partitioned_parquet_snap.store_sales.ss_net_paid)) > CAST(multiply(CAST(0.05 AS DECIMAL(3,2)), avg(sum(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_paid))) AS DECIMAL(38,2))
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=13,28 row-size=84B cardinality=79.62K cost=16314
| in pipelines: 37(GETNEXT), 47(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q44.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q44.test
index 2548d39cb..778f4a103 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q44.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q44.test
@@ -88,7 +88,7 @@ PLAN-ROOT SINK
| | | in pipelines: 16(GETNEXT), 12(OPEN)
| | |
| | 15:NESTED LOOP JOIN [INNER JOIN]
-| | | join predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales_1.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_2.ss_net_profit))
+| | | predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales_1.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_2.ss_net_profit))
| | | mem-estimate=12B mem-reservation=0B thread-reservation=0
| | | tuple-ids=21,25 row-size=24B cardinality=360.18K cost=73800
| | | in pipelines: 12(GETNEXT), 14(OPEN)
@@ -179,7 +179,7 @@ PLAN-ROOT SINK
| | in pipelines: 06(GETNEXT), 02(OPEN)
| |
| 05:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_profit))
+| | predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_profit))
| | mem-estimate=12B mem-reservation=0B thread-reservation=0
| | tuple-ids=5,9 row-size=24B cardinality=360.18K cost=73800
| | in pipelines: 02(GETNEXT), 04(OPEN)
@@ -353,7 +353,7 @@ max-parallelism=4 segment-costs=[0, 2] cpu-comparison-result=480 [max(8 (self) v
| | |
| | 15:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | | join table id: 02
-| | | join predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales_1.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_2.ss_net_profit))
+| | | predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales_1.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_2.ss_net_profit))
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=21,25 row-size=24B cardinality=360.18K cost=73800
| | | in pipelines: 31(GETNEXT), 33(OPEN)
@@ -531,7 +531,7 @@ max-parallelism=4 segment-costs=[241660]
| |
| 05:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 04
-| | join predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_profit))
+| | predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_profit))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=5,9 row-size=24B cardinality=360.18K cost=73800
| | in pipelines: 23(GETNEXT), 25(OPEN)
@@ -750,7 +750,7 @@ max-parallelism=4 segment-costs=[0, 2] cpu-comparison-result=480 [max(8 (self) v
| | |
| | 15:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | | join table id: 02
-| | | join predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales_1.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_2.ss_net_profit))
+| | | predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales_1.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_2.ss_net_profit))
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=21,25 row-size=24B cardinality=360.18K cost=73800
| | | in pipelines: 31(GETNEXT), 33(OPEN)
@@ -928,7 +928,7 @@ max-parallelism=4 segment-costs=[241660]
| |
| 05:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 04
-| | join predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_profit))
+| | predicates: CAST(avg(tpcds_partitioned_parquet_snap.store_sales.ss_net_profit) AS DECIMAL(14,7)) > multiply(CAST(0.9 AS DECIMAL(2,1)), avg(tpcds_partitioned_parquet_snap.store_sales_0.ss_net_profit))
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=5,9 row-size=24B cardinality=360.18K cost=73800
| | in pipelines: 23(GETNEXT), 25(OPEN)
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q54.test b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q54.test
index e40d2f9ec..bbd8a00a3 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q54.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q54.test
@@ -135,7 +135,7 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT), 12(OPEN)
|
|--20:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) <= add(tpcds_partitioned_parquet_snap.date_dim_2.d_month_seq, 3)
+| | predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) <= add(tpcds_partitioned_parquet_snap.date_dim_2.d_month_seq, 3)
| | mem-estimate=8B mem-reservation=0B thread-reservation=0
| | tuple-ids=14,18,21 row-size=24B cardinality=73.05K cost=14967
| | in pipelines: 12(GETNEXT), 19(OPEN)
@@ -167,7 +167,7 @@ PLAN-ROOT SINK
| | in pipelines: 17(GETNEXT)
| |
| 16:NESTED LOOP JOIN [INNER JOIN]
-| | join predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) >= add(tpcds_partitioned_parquet_snap.date_dim_1.d_month_seq, 1)
+| | predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) >= add(tpcds_partitioned_parquet_snap.date_dim_1.d_month_seq, 1)
| | mem-estimate=8B mem-reservation=0B thread-reservation=0
| | tuple-ids=14,18 row-size=16B cardinality=73.05K cost=14967
| | in pipelines: 12(GETNEXT), 15(OPEN)
@@ -510,7 +510,7 @@ max-parallelism=1060 segment-costs=[10515440063, 340687519] cpu-comparison-resul
| max-parallelism=1 segment-costs=[51921]
| 20:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 03
-| | join predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) <= add(tpcds_partitioned_parquet_snap.date_dim_2.d_month_seq, 3)
+| | predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) <= add(tpcds_partitioned_parquet_snap.date_dim_2.d_month_seq, 3)
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=14,18,21 row-size=24B cardinality=73.05K cost=14967
| | in pipelines: 12(GETNEXT), 19(OPEN)
@@ -582,7 +582,7 @@ max-parallelism=1060 segment-costs=[10515440063, 340687519] cpu-comparison-resul
| |
| 16:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 04
-| | join predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) >= add(tpcds_partitioned_parquet_snap.date_dim_1.d_month_seq, 1)
+| | predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) >= add(tpcds_partitioned_parquet_snap.date_dim_1.d_month_seq, 1)
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=14,18 row-size=16B cardinality=73.05K cost=14967
| | in pipelines: 12(GETNEXT), 15(OPEN)
@@ -1048,7 +1048,7 @@ max-parallelism=1060 segment-costs=[10515440063, 340687519] cpu-comparison-resul
| max-parallelism=1 segment-costs=[51921]
| 20:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 03
-| | join predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) <= add(tpcds_partitioned_parquet_snap.date_dim_2.d_month_seq, 3)
+| | predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) <= add(tpcds_partitioned_parquet_snap.date_dim_2.d_month_seq, 3)
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=14,18,21 row-size=24B cardinality=73.05K cost=14967
| | in pipelines: 12(GETNEXT), 19(OPEN)
@@ -1120,7 +1120,7 @@ max-parallelism=1060 segment-costs=[10515440063, 340687519] cpu-comparison-resul
| |
| 16:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
| | join table id: 04
-| | join predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) >= add(tpcds_partitioned_parquet_snap.date_dim_1.d_month_seq, 1)
+| | predicates: CAST(tpcds_partitioned_parquet_snap.date_dim_0.d_month_seq AS BIGINT) >= add(tpcds_partitioned_parquet_snap.date_dim_1.d_month_seq, 1)
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=14,18 row-size=16B cardinality=73.05K cost=14967
| | in pipelines: 12(GETNEXT), 15(OPEN)