You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by en...@apache.org on 2026/03/05 06:14:11 UTC
(doris) branch master updated: [feat](eager-agg)stabilize and extend eager aggregation pushdown (join/outer join/case-if/count-if) with broad regression baseline refresh (#60757)
This is an automated email from the ASF dual-hosted git repository.
englefly pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new e463abfae40 [feat](eager-agg)stabilize and extend eager aggregation pushdown (join/outer join/case-if/count-if) with broad regression baseline refresh (#60757)
e463abfae40 is described below
commit e463abfae40a19991e0dee135ead4d625f4bf710
Author: minghong <zh...@selectdb.com>
AuthorDate: Thu Mar 5 14:14:04 2026 +0800
[feat](eager-agg)stabilize and extend eager aggregation pushdown (join/outer join/case-if/count-if) with broad regression baseline refresh (#60757)
### What problem does this PR solve?
This PR significantly improves Nereids eager aggregation pushdown and
stabilizes plan behavior across join-heavy workloads.
It introduces a new/expanded eager-agg rewrite pipeline, fixes multiple
correctness edge cases (especially around outer joins and nullable
semantics), and refreshes regression/shape baselines accordingly.
### What this PR changes
Adds and refines eager aggregation pushdown infrastructure and rewrite
flow (EagerAggRewriter, PushDownAggregation, PushDownAggContext).
Improves pushdown coverage for count, count(if(...)), min(if(...)),
max(if(...)), and case-when/if related expressions.
Fixes outer join null-complement-side protections to avoid invalid
pushdown.
Adds safety guards to prevent invalid rewrites (e.g., nullable checks,
invalid context/group key states, NDV-based stop conditions).
Improves rewrite behavior around Project/Union/SetOp interactions and
expression-id alignment.
Updates plan-checking diagnostics and adds/updates unit tests for
eager-agg rewrite validation.
Refreshes and reorganizes regression suites and shape baselines,
including large-scale updates for TPC-DS shape checks (with and without
PK/FK assumptions).
### Scale of change
297 files changed
+26,291 / -11,811
### Why this matters
Better optimizer coverage for aggregation pushdown in real-world join
patterns.
More stable and correct behavior for complex expressions (if, case-when)
and outer joins.
Better performance opportunities in selected workloads while keeping
rewrite safety constraints.
Notes
This is a consolidation-style commit containing multiple related fixes
and baseline updates from ongoing eager-agg workstreams, plus
rebase-driven shape adjustments.
---
.../doris/nereids/jobs/executor/Rewriter.java | 56 +-
.../doris/nereids/pattern/DescribedPredicate.java | 52 +
.../org/apache/doris/nereids/pattern/Pattern.java | 70 +
.../doris/nereids/pattern/PatternDescriptor.java | 5 +
.../nereids/rules/analysis/NormalizeAggregate.java | 51 +-
.../nereids/rules/rewrite/AdjustNullable.java | 19 +-
.../doris/nereids/rules/rewrite/ColumnPruning.java | 47 +-
.../doris/nereids/rules/rewrite/OrExpansion.java | 28 +-
.../rewrite/eageraggregation/EagerAggRewriter.java | 625 +++
.../eageraggregation/PushDownAggContext.java | 144 +
.../eageraggregation/PushDownAggregation.java | 319 ++
.../doris/nereids/stats/ExpressionEstimation.java | 2 +-
.../trees/expressions/functions/BoundFunction.java | 4 +
.../trees/plans/logical/LogicalFileScan.java | 2 +-
.../trees/plans/logical/LogicalOlapScan.java | 2 +-
.../trees/plans/logical/LogicalProject.java | 20 +-
.../trees/plans/logical/LogicalSetOperation.java | 86 +-
.../nereids/trees/plans/logical/LogicalUnion.java | 10 +-
.../apache/doris/nereids/util/ExpressionUtils.java | 100 +-
.../java/org/apache/doris/qe/SessionVariable.java | 40 +
.../java/org/apache/doris/qe/StmtExecutor.java | 4 +-
.../PushDownExpressionsInHashConditionTest.java | 8 +-
.../eageraggregation/EagerAggRewriterTest.java | 285 ++
.../nereids/trees/plans/PlanToStringTest.java | 3 +-
.../apache/doris/nereids/util/MatchingUtils.java | 54 +
.../org/apache/doris/nereids/util/PlanChecker.java | 24 +-
.../data/nereids_p0/eager_agg/eager_agg.out | 313 ++
.../nereids_rules_p0/eager_aggregate/basic.out | 98 -
.../eager_aggregate/basic_one_side.out | 98 -
...h_down_count_distinct_through_join_one_side.out | 237 -
.../push_down_count_through_join.out | 1032 ----
.../push_down_count_through_join_one_side.out | 1093 -----
.../eager_aggregate/push_down_max_through_join.out | 592 ---
...ush_down_min_distinct_through_join_one_side.out | 237 -
.../eager_aggregate/push_down_min_through_join.out | 592 ---
...ush_down_sum_distinct_through_join_one_side.out | 231 -
.../eager_aggregate/push_down_sum_through_join.out | 569 ---
.../push_down_sum_through_join_one_side.out | 592 ---
.../shape_check/tpcds_sf100/rf_prune/query14.out | 78 +-
.../shape_check/tpcds_sf100/rf_prune/query2.out | 22 +-
.../shape_check/tpcds_sf100/rf_prune/query3.out | 19 +-
.../shape_check/tpcds_sf100/rf_prune/query31.out | 18 +-
.../shape_check/tpcds_sf100/rf_prune/query42.out | 9 +-
.../shape_check/tpcds_sf100/rf_prune/query43.out | 9 +-
.../shape_check/tpcds_sf100/rf_prune/query52.out | 9 +-
.../shape_check/tpcds_sf100/rf_prune/query55.out | 9 +-
.../shape_check/tpcds_sf100/rf_prune/query59.out | 9 +-
.../shape_check/tpcds_sf100/rf_prune/query64.out | 129 +-
.../data/shape_check/tpcds_sf100/shape/query14.out | 78 +-
.../data/shape_check/tpcds_sf100/shape/query2.out | 22 +-
.../data/shape_check/tpcds_sf100/shape/query3.out | 19 +-
.../data/shape_check/tpcds_sf100/shape/query31.out | 18 +-
.../data/shape_check/tpcds_sf100/shape/query42.out | 9 +-
.../data/shape_check/tpcds_sf100/shape/query43.out | 9 +-
.../data/shape_check/tpcds_sf100/shape/query52.out | 9 +-
.../data/shape_check/tpcds_sf100/shape/query55.out | 9 +-
.../data/shape_check/tpcds_sf100/shape/query59.out | 9 +-
.../data/shape_check/tpcds_sf100/shape/query64.out | 129 +-
.../data/shape_check/tpcds_sf1000/hint/query14.out | 78 +-
.../data/shape_check/tpcds_sf1000/hint/query2.out | 16 +-
.../data/shape_check/tpcds_sf1000/hint/query31.out | 18 +-
.../data/shape_check/tpcds_sf1000/hint/query42.out | 9 +-
.../data/shape_check/tpcds_sf1000/hint/query43.out | 9 +-
.../data/shape_check/tpcds_sf1000/hint/query52.out | 9 +-
.../data/shape_check/tpcds_sf1000/hint/query59.out | 9 +-
.../shape_check/tpcds_sf1000/shape/query14.out | 78 +-
.../data/shape_check/tpcds_sf1000/shape/query2.out | 22 +-
.../data/shape_check/tpcds_sf1000/shape/query3.out | 19 +-
.../shape_check/tpcds_sf1000/shape/query31.out | 18 +-
.../shape_check/tpcds_sf1000/shape/query42.out | 9 +-
.../shape_check/tpcds_sf1000/shape/query43.out | 9 +-
.../shape_check/tpcds_sf1000/shape/query52.out | 9 +-
.../shape_check/tpcds_sf1000/shape/query55.out | 9 +-
.../shape_check/tpcds_sf1000/shape/query59.out | 9 +-
.../tpcds_sf1000_nopkfk/shape/query1.out | 37 +
.../tpcds_sf1000_nopkfk/shape/query10.out | 47 +
.../tpcds_sf1000_nopkfk/shape/query11.out | 63 +
.../tpcds_sf1000_nopkfk/shape/query12.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query13.out | 34 +
.../shape/query14.out | 78 +-
.../tpcds_sf1000_nopkfk/shape/query15.out | 25 +
.../tpcds_sf1000_nopkfk/shape/query16.out | 35 +
.../tpcds_sf1000_nopkfk/shape/query17.out | 44 +
.../tpcds_sf1000_nopkfk/shape/query18.out | 42 +
.../tpcds_sf1000_nopkfk/shape/query19.out | 35 +
.../shape/query2.out | 22 +-
.../tpcds_sf1000_nopkfk/shape/query20.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query21.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query22.out | 23 +
.../tpcds_sf1000_nopkfk/shape/query23.out | 89 +
.../tpcds_sf1000_nopkfk/shape/query24.out | 52 +
.../tpcds_sf1000_nopkfk/shape/query25.out | 43 +
.../tpcds_sf1000_nopkfk/shape/query26.out | 31 +
.../tpcds_sf1000_nopkfk/shape/query27.out | 33 +
.../tpcds_sf1000_nopkfk/shape/query28.out | 75 +
.../tpcds_sf1000_nopkfk/shape/query29.out | 43 +
.../tpcds_sf1000_nopkfk/shape/query3.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query30.out | 41 +
.../shape/query31.out | 18 +-
.../tpcds_sf1000_nopkfk/shape/query32.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query33.out | 83 +
.../tpcds_sf1000_nopkfk/shape/query34.out | 32 +
.../tpcds_sf1000_nopkfk/shape/query35.out | 47 +
.../tpcds_sf1000_nopkfk/shape/query36.out | 33 +
.../tpcds_sf1000_nopkfk/shape/query37.out | 27 +
.../tpcds_sf1000_nopkfk/shape/query38.out | 53 +
.../tpcds_sf1000_nopkfk/shape/query39.out | 31 +
.../tpcds_sf1000_nopkfk/shape/query4.out | 91 +
.../tpcds_sf1000_nopkfk/shape/query40.out | 30 +
.../tpcds_sf1000_nopkfk/shape/query41.out | 23 +
.../hint => tpcds_sf1000_nopkfk/shape}/query42.out | 14 +-
.../hint => tpcds_sf1000_nopkfk/shape}/query43.out | 14 +-
.../tpcds_sf1000_nopkfk/shape/query44.out | 71 +
.../tpcds_sf1000_nopkfk/shape/query45.out | 35 +
.../tpcds_sf1000_nopkfk/shape/query46.out | 38 +
.../tpcds_sf1000_nopkfk/shape/query47.out | 43 +
.../tpcds_sf1000_nopkfk/shape/query48.out | 29 +
.../tpcds_sf1000_nopkfk/shape/query49.out | 107 +
.../tpcds_sf1000_nopkfk/shape/query5.out | 77 +
.../tpcds_sf1000_nopkfk/shape/query50.out | 29 +
.../tpcds_sf1000_nopkfk/shape/query51.out | 40 +
.../hint => tpcds_sf1000_nopkfk/shape}/query52.out | 14 +-
.../tpcds_sf1000_nopkfk/shape/query53.out | 31 +
.../tpcds_sf1000_nopkfk/shape/query54.out | 74 +
.../shape/query55.out | 9 +-
.../tpcds_sf1000_nopkfk/shape/query56.out | 83 +
.../tpcds_sf1000_nopkfk/shape/query57.out | 43 +
.../tpcds_sf1000_nopkfk/shape/query58.out | 86 +
.../shape/query59.out | 9 +-
.../tpcds_sf1000_nopkfk/shape/query6.out | 47 +
.../tpcds_sf1000_nopkfk/shape/query60.out | 83 +
.../tpcds_sf1000_nopkfk/shape/query61.out | 70 +
.../tpcds_sf1000_nopkfk/shape/query62.out | 29 +
.../tpcds_sf1000_nopkfk/shape/query63.out | 31 +
.../shape/query64.out | 22 +-
.../tpcds_sf1000_nopkfk/shape/query65.out | 43 +
.../tpcds_sf1000_nopkfk/shape/query66.out | 61 +
.../tpcds_sf1000_nopkfk/shape/query67.out | 42 +
.../tpcds_sf1000_nopkfk/shape/query68.out | 40 +
.../tpcds_sf1000_nopkfk/shape/query69.out | 47 +
.../tpcds_sf1000_nopkfk/shape/query7.out | 31 +
.../tpcds_sf1000_nopkfk/shape/query70.out | 44 +
.../tpcds_sf1000_nopkfk/shape/query71.out | 36 +
.../tpcds_sf1000_nopkfk/shape/query72.out | 58 +
.../tpcds_sf1000_nopkfk/shape/query73.out | 32 +
.../tpcds_sf1000_nopkfk/shape/query74.out | 63 +
.../tpcds_sf1000_nopkfk/shape/query75.out | 68 +
.../tpcds_sf1000_nopkfk/shape/query76.out | 38 +
.../tpcds_sf1000_nopkfk/shape/query77.out | 101 +
.../tpcds_sf1000_nopkfk/shape/query78.out | 57 +
.../tpcds_sf1000_nopkfk/shape/query79.out | 32 +
.../tpcds_sf1000_nopkfk/shape/query8.out | 47 +
.../tpcds_sf1000_nopkfk/shape/query80.out | 100 +
.../tpcds_sf1000_nopkfk/shape/query81.out | 41 +
.../tpcds_sf1000_nopkfk/shape/query82.out | 27 +
.../tpcds_sf1000_nopkfk/shape/query83.out | 80 +
.../tpcds_sf1000_nopkfk/shape/query84.out | 31 +
.../tpcds_sf1000_nopkfk/shape/query85.out | 46 +
.../tpcds_sf1000_nopkfk/shape/query86.out | 28 +
.../tpcds_sf1000_nopkfk/shape/query87.out | 51 +
.../tpcds_sf1000_nopkfk/shape/query88.out | 171 +
.../tpcds_sf1000_nopkfk/shape/query89.out | 31 +
.../tpcds_sf1000_nopkfk/shape/query9.out | 115 +
.../tpcds_sf1000_nopkfk/shape/query90.out | 47 +
.../tpcds_sf1000_nopkfk/shape/query91.out | 41 +
.../tpcds_sf1000_nopkfk/shape/query92.out | 25 +
.../tpcds_sf1000_nopkfk/shape/query93.out | 21 +
.../tpcds_sf1000_nopkfk/shape/query94.out | 35 +
.../tpcds_sf1000_nopkfk/shape/query95.out | 44 +
.../tpcds_sf1000_nopkfk/shape/query96.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query97.out | 35 +
.../tpcds_sf1000_nopkfk/shape/query98.out | 26 +
.../tpcds_sf1000_nopkfk/shape/query99.out | 29 +
.../data/shape_check/tpch_sf1000/hint/q10.out | 7 +-
.../data/shape_check/tpch_sf1000/hint/q13.out | 11 +-
.../data/shape_check/tpch_sf1000/hint/q3.out | 7 +-
.../data/shape_check/tpch_sf1000/rf_prune/q10.out | 29 +-
.../data/shape_check/tpch_sf1000/rf_prune/q13.out | 11 +-
.../data/shape_check/tpch_sf1000/rf_prune/q3.out | 7 +-
.../data/shape_check/tpch_sf1000/shape/q10.out | 29 +-
.../data/shape_check/tpch_sf1000/shape/q13.out | 11 +-
.../data/shape_check/tpch_sf1000/shape/q3.out | 7 +-
.../suites/nereids_p0/eager_agg/eager_agg.groovy | 414 ++
.../suites/nereids_p0/eager_agg/load.groovy | 299 ++
.../nereids_rules_p0/eager_aggregate/basic.groovy | 203 -
.../eager_aggregate/basic_one_side.groovy | 204 -
...aggr_distinct_through_join_one_side_cust.groovy | 130 -
...own_count_distinct_through_join_one_side.groovy | 259 -
.../push_down_count_through_join.groovy | 429 --
.../push_down_count_through_join_one_side.groovy | 524 --
.../push_down_max_through_join.groovy | 261 -
..._down_min_distinct_through_join_one_side.groovy | 257 -
.../push_down_min_through_join.groovy | 260 -
..._down_sum_distinct_through_join_one_side.groovy | 253 -
.../push_down_sum_through_join.groovy | 259 -
.../push_down_sum_through_join_one_side.groovy | 259 -
.../suites/shape_check/tpcds_sf1000/load.groovy | 5080 ++++++++++----------
.../load.groovy | 5060 ++++++++++---------
.../tpcds_sf1000_nopkfk/shape/query1.groovy | 86 +
.../tpcds_sf1000_nopkfk/shape/query10.groovy | 154 +
.../tpcds_sf1000_nopkfk/shape/query11.groovy | 198 +
.../tpcds_sf1000_nopkfk/shape/query12.groovy | 104 +
.../tpcds_sf1000_nopkfk/shape/query13.groovy | 140 +
.../tpcds_sf1000_nopkfk/shape/query14.groovy | 244 +
.../tpcds_sf1000_nopkfk/shape/query15.groovy | 76 +
.../tpcds_sf1000_nopkfk/shape/query16.groovy | 98 +
.../tpcds_sf1000_nopkfk/shape/query17.groovy | 126 +
.../tpcds_sf1000_nopkfk/shape/query18.groovy | 104 +
.../tpcds_sf1000_nopkfk/shape/query19.groovy | 86 +
.../tpcds_sf1000_nopkfk/shape/query2.groovy | 156 +
.../tpcds_sf1000_nopkfk/shape/query20.groovy | 96 +
.../tpcds_sf1000_nopkfk/shape/query21.groovy | 97 +
.../tpcds_sf1000_nopkfk/shape/query22.groovy | 76 +
.../tpcds_sf1000_nopkfk/shape/query23.groovy | 143 +
.../tpcds_sf1000_nopkfk/shape/query24.groovy | 146 +
.../tpcds_sf1000_nopkfk/shape/query25.groovy | 132 +
.../tpcds_sf1000_nopkfk/shape/query26.groovy | 78 +
.../tpcds_sf1000_nopkfk/shape/query27.groovy | 82 +
.../tpcds_sf1000_nopkfk/shape/query28.groovy | 142 +
.../tpcds_sf1000_nopkfk/shape/query29.groovy | 130 +
.../tpcds_sf1000_nopkfk/shape/query3.groovy | 78 +
.../tpcds_sf1000_nopkfk/shape/query30.groovy | 98 +
.../tpcds_sf1000_nopkfk/shape/query31.groovy | 140 +
.../tpcds_sf1000_nopkfk/shape/query32.groovy | 95 +
.../tpcds_sf1000_nopkfk/shape/query33.groovy | 186 +
.../tpcds_sf1000_nopkfk/shape/query34.groovy | 98 +
.../tpcds_sf1000_nopkfk/shape/query35.groovy | 152 +
.../tpcds_sf1000_nopkfk/shape/query36.groovy | 96 +
.../tpcds_sf1000_nopkfk/shape/query37.groovy | 70 +
.../tpcds_sf1000_nopkfk/shape/query38.groovy | 85 +
.../tpcds_sf1000_nopkfk/shape/query39.groovy | 90 +
.../tpcds_sf1000_nopkfk/shape/query4.groovy | 268 ++
.../tpcds_sf1000_nopkfk/shape/query40.groovy | 92 +
.../tpcds_sf1000_nopkfk/shape/query41.groovy | 140 +
.../tpcds_sf1000_nopkfk/shape/query42.groovy | 80 +
.../tpcds_sf1000_nopkfk/shape/query43.groovy | 74 +
.../tpcds_sf1000_nopkfk/shape/query44.groovy | 106 +
.../tpcds_sf1000_nopkfk/shape/query45.groovy | 76 +
.../tpcds_sf1000_nopkfk/shape/query46.groovy | 106 +
.../tpcds_sf1000_nopkfk/shape/query47.groovy | 138 +
.../tpcds_sf1000_nopkfk/shape/query48.groovy | 170 +
.../tpcds_sf1000_nopkfk/shape/query49.groovy | 294 ++
.../tpcds_sf1000_nopkfk/shape/query5.groovy | 292 ++
.../tpcds_sf1000_nopkfk/shape/query50.groovy | 154 +
.../tpcds_sf1000_nopkfk/shape/query51.groovy | 126 +
.../tpcds_sf1000_nopkfk/shape/query52.groovy | 80 +
.../tpcds_sf1000_nopkfk/shape/query53.groovy | 92 +
.../tpcds_sf1000_nopkfk/shape/query54.groovy | 148 +
.../tpcds_sf1000_nopkfk/shape/query55.groovy | 64 +
.../tpcds_sf1000_nopkfk/shape/query56.groovy | 174 +
.../tpcds_sf1000_nopkfk/shape/query57.groovy | 132 +
.../tpcds_sf1000_nopkfk/shape/query58.groovy | 166 +
.../tpcds_sf1000_nopkfk/shape/query59.groovy | 124 +
.../tpcds_sf1000_nopkfk/shape/query6.groovy | 88 +
.../tpcds_sf1000_nopkfk/shape/query60.groovy | 192 +
.../tpcds_sf1000_nopkfk/shape/query61.groovy | 124 +
.../tpcds_sf1000_nopkfk/shape/query62.groovy | 106 +
.../tpcds_sf1000_nopkfk/shape/query63.groovy | 94 +
.../tpcds_sf1000_nopkfk/shape/query64.groovy | 279 ++
.../tpcds_sf1000_nopkfk/shape/query65.groovy | 94 +
.../tpcds_sf1000_nopkfk/shape/query66.groovy | 476 ++
.../tpcds_sf1000_nopkfk/shape/query67.groovy | 124 +
.../tpcds_sf1000_nopkfk/shape/query68.groovy | 120 +
.../tpcds_sf1000_nopkfk/shape/query69.groovy | 130 +
.../tpcds_sf1000_nopkfk/shape/query7.groovy | 78 +
.../tpcds_sf1000_nopkfk/shape/query70.groovy | 112 +
.../tpcds_sf1000_nopkfk/shape/query71.groovy | 116 +
.../tpcds_sf1000_nopkfk/shape/query72.groovy | 94 +
.../tpcds_sf1000_nopkfk/shape/query73.groovy | 92 +
.../tpcds_sf1000_nopkfk/shape/query74.groovy | 158 +
.../tpcds_sf1000_nopkfk/shape/query75.groovy | 176 +
.../tpcds_sf1000_nopkfk/shape/query76.groovy | 84 +
.../tpcds_sf1000_nopkfk/shape/query77.groovy | 252 +
.../tpcds_sf1000_nopkfk/shape/query78.groovy | 152 +
.../tpcds_sf1000_nopkfk/shape/query79.groovy | 82 +
.../tpcds_sf1000_nopkfk/shape/query8.groovy | 253 +
.../tpcds_sf1000_nopkfk/shape/query80.groovy | 228 +
.../tpcds_sf1000_nopkfk/shape/query81.groovy | 98 +
.../tpcds_sf1000_nopkfk/shape/query82.groovy | 70 +
.../tpcds_sf1000_nopkfk/shape/query83.groovy | 170 +
.../tpcds_sf1000_nopkfk/shape/query84.groovy | 78 +
.../tpcds_sf1000_nopkfk/shape/query85.groovy | 204 +
.../tpcds_sf1000_nopkfk/shape/query86.groovy | 88 +
.../tpcds_sf1000_nopkfk/shape/query87.groovy | 82 +
.../tpcds_sf1000_nopkfk/shape/query88.groovy | 224 +
.../tpcds_sf1000_nopkfk/shape/query89.groovy | 92 +
.../tpcds_sf1000_nopkfk/shape/query9.groovy | 139 +
.../tpcds_sf1000_nopkfk/shape/query90.groovy | 80 +
.../tpcds_sf1000_nopkfk/shape/query91.groovy | 98 +
.../tpcds_sf1000_nopkfk/shape/query92.groovy | 96 +
.../tpcds_sf1000_nopkfk/shape/query93.groovy | 72 +
.../tpcds_sf1000_nopkfk/shape/query94.groovy | 94 +
.../tpcds_sf1000_nopkfk/shape/query95.groovy | 100 +
.../tpcds_sf1000_nopkfk/shape/query96.groovy | 68 +
.../tpcds_sf1000_nopkfk/shape/query97.groovy | 89 +
.../tpcds_sf1000_nopkfk/shape/query98.groovy | 102 +
.../tpcds_sf1000_nopkfk/shape/query99.groovy | 106 +
297 files changed, 25866 insertions(+), 14440 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java
index a39a3c0a9ff..00be607fc94 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java
@@ -128,7 +128,6 @@ import org.apache.doris.nereids.rules.rewrite.PullUpProjectUnderApply;
import org.apache.doris.nereids.rules.rewrite.PullUpProjectUnderLimit;
import org.apache.doris.nereids.rules.rewrite.PullUpProjectUnderTopN;
import org.apache.doris.nereids.rules.rewrite.PushCountIntoUnionAll;
-import org.apache.doris.nereids.rules.rewrite.PushDownAggThroughJoin;
import org.apache.doris.nereids.rules.rewrite.PushDownAggThroughJoinOnPkFk;
import org.apache.doris.nereids.rules.rewrite.PushDownAggThroughJoinOneSide;
import org.apache.doris.nereids.rules.rewrite.PushDownAggWithDistinctThroughJoinOneSide;
@@ -173,6 +172,7 @@ import org.apache.doris.nereids.rules.rewrite.VariantSubPathPruning;
import org.apache.doris.nereids.rules.rewrite.batch.ApplyToJoin;
import org.apache.doris.nereids.rules.rewrite.batch.CorrelateApplyToUnCorrelateApply;
import org.apache.doris.nereids.rules.rewrite.batch.EliminateUselessPlanUnderApply;
+import org.apache.doris.nereids.rules.rewrite.eageraggregation.PushDownAggregation;
import org.apache.doris.nereids.trees.plans.algebra.SetOperation;
import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
import org.apache.doris.nereids.trees.plans.logical.LogicalApply;
@@ -657,19 +657,6 @@ public class Rewriter extends AbstractBatchJobExecutor {
new MergeAggregate()
)
),
- topic("Eager aggregation",
- cascadesContext -> cascadesContext.rewritePlanContainsTypes(
- LogicalAggregate.class, LogicalJoin.class
- ),
- costBased(topDown(
- new PushDownAggWithDistinctThroughJoinOneSide(),
- new PushDownAggThroughJoinOneSide(),
- new PushDownAggThroughJoin()
- )),
- costBased(custom(RuleType.PUSH_DOWN_DISTINCT_THROUGH_JOIN, PushDownDistinctThroughJoin::new)),
- topDown(new PushCountIntoUnionAll())
- ),
-
// this rule should invoke after infer predicate and push down distinct, and before push down limit
topic("eliminate join according unique or foreign key",
cascadesContext -> cascadesContext.rewritePlanContainsTypes(LogicalJoin.class),
@@ -686,7 +673,19 @@ public class Rewriter extends AbstractBatchJobExecutor {
topDown(new PushDownAggThroughJoinOnPkFk()),
topDown(new PullUpJoinFromUnionAll())
),
+ topic("Eager aggregation",
+ cascadesContext -> cascadesContext.rewritePlanContainsTypes(
+ LogicalAggregate.class, LogicalJoin.class
+ ),
+ costBased(topDown(
+ new PushDownAggWithDistinctThroughJoinOneSide(),
+ new PushDownAggThroughJoinOneSide()
+ )),
+ costBased(custom(RuleType.PUSH_DOWN_DISTINCT_THROUGH_JOIN, PushDownDistinctThroughJoin::new)),
+ custom(RuleType.PUSH_DOWN_AGG_THROUGH_JOIN, PushDownAggregation::new),
+ topDown(new PushCountIntoUnionAll())
+ ),
topic("Limit optimization",
cascadesContext -> cascadesContext.rewritePlanContainsTypes(LogicalLimit.class)
|| cascadesContext.rewritePlanContainsTypes(LogicalTopN.class)
@@ -936,23 +935,24 @@ public class Rewriter extends AbstractBatchJobExecutor {
}
rewriteJobs.add(
topic("nested column prune",
- custom(RuleType.NESTED_COLUMN_PRUNING, NestedColumnPruning::new)
+ custom(RuleType.NESTED_COLUMN_PRUNING, NestedColumnPruning::new)
)
);
rewriteJobs.addAll(jobs(
- topic("rewrite cte sub-tree after sub path push down",
- custom(RuleType.CLEAR_CONTEXT_STATUS, ClearContextStatus::new),
- custom(RuleType.REWRITE_CTE_CHILDREN,
- () -> new RewriteCteChildren(afterPushDownJobs, runCboRules)
- )
- ),
- topic("whole plan check",
- custom(RuleType.ADJUST_NULLABLE, () -> new AdjustNullable(false))
- ),
- // NullableDependentExpressionRewrite need to be done after nullable fixed
- topic("condition function", bottomUp(ImmutableList.of(
- new NullableDependentExpressionRewrite())))
- ));
+ topic("rewrite cte sub-tree after sub path push down",
+ custom(RuleType.CLEAR_CONTEXT_STATUS, ClearContextStatus::new),
+ custom(RuleType.REWRITE_CTE_CHILDREN,
+ () -> new RewriteCteChildren(afterPushDownJobs, runCboRules)
+ )
+ ),
+ topic("whole plan check",
+ custom(RuleType.ADJUST_NULLABLE, () -> new AdjustNullable(false))
+ ),
+ // NullableDependentExpressionRewrite need to be done after nullable fixed
+ topic("condition function", bottomUp(ImmutableList.of(
+ new NullableDependentExpressionRewrite())))
+ )
+ );
return rewriteJobs;
}
));
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/DescribedPredicate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/DescribedPredicate.java
new file mode 100644
index 00000000000..e94305355c1
--- /dev/null
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/DescribedPredicate.java
@@ -0,0 +1,52 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.pattern;
+
+import java.util.function.Predicate;
+
+/**
+ * A predicate wrapper with a human-readable description.
+ * Used in pattern matching to provide better diagnostic messages when a predicate fails.
+ */
+public class DescribedPredicate<T> implements Predicate<T> {
+ private final String description;
+ private final Predicate<T> delegate;
+
+ public DescribedPredicate(String description, Predicate<T> delegate) {
+ this.description = description;
+ this.delegate = delegate;
+ }
+
+ public static <T> DescribedPredicate<T> of(String description, Predicate<T> delegate) {
+ return new DescribedPredicate<>(description, delegate);
+ }
+
+ @Override
+ public boolean test(T t) {
+ return delegate.test(t);
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String toString() {
+ return description;
+ }
+}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/Pattern.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/Pattern.java
index 4b28a93fa93..6f0da7b866f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/Pattern.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/Pattern.java
@@ -203,6 +203,76 @@ public class Pattern<TYPE extends Plan>
return true;
}
+ /**
+ * Diagnostic version of matchPlanTree. Returns null if match succeeds,
+ * or a human-readable failure reason string if match fails.
+ *
+ * @param plan the plan to match against
+ * @param path the current path in the tree (e.g. "root/child[0]/child[1]")
+ * @return null if matched, or a diagnostic message describing where and why the match failed
+ */
+ public String matchPlanTreeDiagnostic(Plan plan, String path) {
+ if (!matchRoot(plan)) {
+ return path + ": expected node type " + planType + " but got " + plan.getType();
+ }
+ int childPatternNum = arity();
+ if (childPatternNum != plan.arity() && childPatternNum > 0 && child(childPatternNum - 1) != MULTI) {
+ return path + ": expected " + childPatternNum + " children but got " + plan.arity()
+ + " on node " + plan.getType();
+ }
+ switch (patternType) {
+ case ANY:
+ case MULTI:
+ return matchPredicatesDiagnostic((TYPE) plan, path);
+ default:
+ }
+ if (this instanceof SubTreePattern) {
+ return matchPredicatesDiagnostic((TYPE) plan, path);
+ }
+ return matchChildrenAndSelfPredicatesDiagnostic(plan, childPatternNum, path);
+ }
+
+ private String matchChildrenAndSelfPredicatesDiagnostic(Plan plan, int childPatternNum, String path) {
+ List<Plan> childrenPlan = plan.children();
+ for (int i = 0; i < childrenPlan.size(); i++) {
+ Plan child = childrenPlan.get(i);
+ Pattern childPattern = child(Math.min(i, childPatternNum - 1));
+ String childPath = path + "/" + plan.getType() + ".child[" + i + "]";
+ String childResult = childPattern.matchPlanTreeDiagnostic(child, childPath);
+ if (childResult != null) {
+ return childResult;
+ }
+ }
+ return matchPredicatesDiagnostic((TYPE) plan, path);
+ }
+
+ /**
+ * Diagnostic version of matchPredicates. Returns null if all predicates pass,
+ * or a message describing which predicate failed.
+ */
+ public String matchPredicatesDiagnostic(TYPE root, String path) {
+ for (int i = 0; i < predicates.size(); i++) {
+ Predicate<TYPE> predicate = predicates.get(i);
+ try {
+ if (!predicate.test(root)) {
+ String predicateDesc = (predicate instanceof DescribedPredicate)
+ ? ((DescribedPredicate<TYPE>) predicate).getDescription()
+ : "predicate #" + (i + 1);
+ return path + " (" + root.getType() + "): " + predicateDesc
+ + " failed. [predicate " + (i + 1) + "/" + predicates.size() + "]";
+ }
+ } catch (Throwable t) {
+ String predicateDesc = (predicate instanceof DescribedPredicate)
+ ? ((DescribedPredicate<TYPE>) predicate).getDescription()
+ : "predicate #" + (i + 1);
+ return path + " (" + root.getType() + "): " + predicateDesc
+ + " threw " + t.getClass().getSimpleName() + ": " + t.getMessage()
+ + " [predicate " + (i + 1) + "/" + predicates.size() + "]";
+ }
+ }
+ return null;
+ }
+
@Override
public Pattern<? extends Plan> withChildren(
List<Pattern<? extends Plan>> children) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/PatternDescriptor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/PatternDescriptor.java
index a3a2baee282..b1dacb8f0c7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/PatternDescriptor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/PatternDescriptor.java
@@ -51,6 +51,11 @@ public class PatternDescriptor<INPUT_TYPE extends Plan> {
return new PatternDescriptor<>(pattern.withPredicates(predicates), defaultPromise);
}
+ /** when with description, the description will be shown in diagnostic message when predicate fails */
+ public PatternDescriptor<INPUT_TYPE> when(String description, Predicate<INPUT_TYPE> predicate) {
+ return when(DescribedPredicate.of(description, predicate));
+ }
+
public PatternDescriptor<INPUT_TYPE> whenNot(Predicate<INPUT_TYPE> predicate) {
return when(predicate.negate());
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/NormalizeAggregate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/NormalizeAggregate.java
index 4a64403dafb..0db8339239a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/NormalizeAggregate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/NormalizeAggregate.java
@@ -130,33 +130,34 @@ public class NormalizeAggregate implements RewriteRuleFactory, NormalizeToSlot {
.toRule(RuleType.NORMALIZE_AGGREGATE));
}
+ /**
+ * The LogicalAggregate node may contain window agg functions and usual agg functions
+ * we call window agg functions as window-agg and usual agg functions as trivial-agg for short
+ * This rule simplify LogicalAggregate node by:
+ * 1. Push down some exprs from old LogicalAggregate node to a new child LogicalProject Node,
+ * 2. create a new LogicalAggregate with normalized group by exprs and trivial-aggs
+ * 3. Pull up normalized old LogicalAggregate's output exprs to a new parent LogicalProject Node
+ * Push down exprs:
+ * 1. all group by exprs
+ * 2. child contains subquery expr in trivial-agg
+ * 3. child contains window expr in trivial-agg
+ * 4. all input slots of trivial-agg
+ * 5. expr(including subquery) in distinct trivial-agg
+ * Normalize LogicalAggregate's output.
+ * 1. normalize group by exprs by outputs of bottom LogicalProject
+ * 2. normalize trivial-aggs by outputs of bottom LogicalProject
+ * 3. build normalized agg outputs
+ * Pull up exprs:
+ * normalize all output exprs in old LogicalAggregate to build a parent project node, typically includes:
+ * 1. simple slots
+ * 2. aliases
+ * a. alias with no aggs child
+ * b. alias with trivial-agg child
+ * c. alias with window-agg
+ */
@SuppressWarnings("checkstyle:UnusedLocalVariable")
- private LogicalPlan normalizeAgg(LogicalAggregate<Plan> aggregate, Optional<LogicalHaving<?>> having,
+ public LogicalPlan normalizeAgg(LogicalAggregate<Plan> aggregate, Optional<LogicalHaving<?>> having,
CascadesContext ctx) {
- // The LogicalAggregate node may contain window agg functions and usual agg functions
- // we call window agg functions as window-agg and usual agg functions as trivial-agg for short
- // This rule simplify LogicalAggregate node by:
- // 1. Push down some exprs from old LogicalAggregate node to a new child LogicalProject Node,
- // 2. create a new LogicalAggregate with normalized group by exprs and trivial-aggs
- // 3. Pull up normalized old LogicalAggregate's output exprs to a new parent LogicalProject Node
- // Push down exprs:
- // 1. all group by exprs
- // 2. child contains subquery expr in trivial-agg
- // 3. child contains window expr in trivial-agg
- // 4. all input slots of trivial-agg
- // 5. expr(including subquery) in distinct trivial-agg
- // Normalize LogicalAggregate's output.
- // 1. normalize group by exprs by outputs of bottom LogicalProject
- // 2. normalize trivial-aggs by outputs of bottom LogicalProject
- // 3. build normalized agg outputs
- // Pull up exprs:
- // normalize all output exprs in old LogicalAggregate to build a parent project node, typically includes:
- // 1. simple slots
- // 2. aliases
- // a. alias with no aggs child
- // b. alias with trivial-agg child
- // c. alias with window-agg
-
// Push down exprs:
// collect group by exprs
Set<Expression> groupingByExprs = Utils.fastToImmutableSet(aggregate.getGroupByExpressions());
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AdjustNullable.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AdjustNullable.java
index 8592d3f22a0..d0d3d33822d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AdjustNullable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AdjustNullable.java
@@ -17,8 +17,6 @@
package org.apache.doris.nereids.rules.rewrite;
-import org.apache.doris.common.util.DebugUtil;
-import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.jobs.JobContext;
import org.apache.doris.nereids.properties.OrderKey;
import org.apache.doris.nereids.trees.expressions.Alias;
@@ -52,6 +50,7 @@ import org.apache.doris.nereids.trees.plans.visitor.CustomRewriter;
import org.apache.doris.nereids.trees.plans.visitor.DefaultPlanRewriter;
import org.apache.doris.nereids.util.ExpressionUtils;
import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.SessionVariable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -59,8 +58,6 @@ import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import java.util.LinkedHashMap;
import java.util.List;
@@ -74,9 +71,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
* So, we need add a rule to adjust all expression's nullable attribute after rewrite.
*/
public class AdjustNullable extends DefaultPlanRewriter<Map<ExprId, Slot>> implements CustomRewriter {
-
- private static final Logger LOG = LogManager.getLogger(AdjustNullable.class);
-
private final boolean isAnalyzedPhase;
public AdjustNullable(boolean isAnalyzedPhase) {
@@ -485,14 +479,9 @@ public class AdjustNullable extends DefaultPlanRewriter<Map<ExprId, Slot>> imple
// repeat may check fail.
if (!slotReference.nullable() && newSlotReference.nullable()
&& check && ConnectContext.get() != null) {
- if (ConnectContext.get().getSessionVariable().feDebug) {
- throw new AnalysisException("AdjustNullable convert slot " + slotReference
- + " from not-nullable to nullable. You can disable check by set fe_debug = false.");
- } else {
- LOG.warn("adjust nullable convert slot '" + slotReference
- + "' from not-nullable to nullable for query "
- + DebugUtil.printId(ConnectContext.get().queryId()));
- }
+ SessionVariable.throwAnalysisExceptionWhenFeDebug("AdjustNullable convert slot "
+ + slotReference
+ + " from not-nullable to nullable. You can disable check by set fe_debug = false.");
}
return newSlotReference;
} else {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ColumnPruning.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ColumnPruning.java
index cc2eb7d2057..685fc984960 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ColumnPruning.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ColumnPruning.java
@@ -59,7 +59,6 @@ import org.apache.doris.nereids.util.Utils;
import org.apache.doris.qe.ConnectContext;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableList.Builder;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.roaringbitmap.RoaringBitmap;
@@ -69,7 +68,6 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
-import java.util.stream.IntStream;
/**
* ColumnPruning.
@@ -221,28 +219,21 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
}
LogicalUnion prunedOutputUnion = pruneUnionOutput(union, context);
// start prune children of union
- List<Slot> originOutput = union.getOutput();
- Set<Slot> prunedOutput = prunedOutputUnion.getOutputSet();
- List<Integer> prunedOutputIndexes = IntStream.range(0, originOutput.size())
- .filter(index -> prunedOutput.contains(originOutput.get(index)))
- .boxed()
- .collect(ImmutableList.toImmutableList());
-
ImmutableList.Builder<Plan> prunedChildren = ImmutableList.builder();
ImmutableList.Builder<List<SlotReference>> prunedChildrenOutputs = ImmutableList.builder();
for (int i = 0; i < prunedOutputUnion.arity(); i++) {
List<SlotReference> regularChildOutputs = prunedOutputUnion.getRegularChildOutput(i);
RoaringBitmap prunedChildOutputExprIds = new RoaringBitmap();
- Builder<SlotReference> prunedChildOutputBuilder
- = ImmutableList.builderWithExpectedSize(regularChildOutputs.size());
- for (Integer index : prunedOutputIndexes) {
- SlotReference slot = regularChildOutputs.get(index);
- prunedChildOutputBuilder.add(slot);
- prunedChildOutputExprIds.add(slot.getExprId().asInt());
- }
-
- List<SlotReference> prunedChildOutput = prunedChildOutputBuilder.build();
+ //Builder<SlotReference> prunedChildOutputBuilder
+ // = ImmutableList.builderWithExpectedSize(regularChildOutputs.size());
+ //for (Integer index : prunedOutputIndexes) {
+ // SlotReference slot = regularChildOutputs.get(index);
+ // prunedChildOutputBuilder.add(slot);
+ // prunedChildOutputExprIds.add(slot.getExprId().asInt());
+ //}
+ regularChildOutputs.forEach(col -> prunedChildOutputExprIds.add(col.getExprId().asInt()));
+ List<SlotReference> prunedChildOutput = regularChildOutputs; //prunedChildOutputBuilder.build();
Plan prunedChild = doPruneChild(
prunedOutputUnion, prunedOutputUnion.child(i), prunedChildOutputExprIds,
prunedChildOutput, true
@@ -420,15 +411,15 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
extractColumnIndex.add(i);
}
}
-
ImmutableList.Builder<List<NamedExpression>> prunedConstantExprsList
= ImmutableList.builderWithExpectedSize(constantExprsList.size());
+ List<List<SlotReference>> prunedRegularChildrenOutputs =
+ Lists.newArrayListWithCapacity(regularChildrenOutputs.size());
if (prunedOutputs.isEmpty()) {
// process prune all columns
NamedExpression originSlot = originOutput.get(0);
prunedOutputs = ImmutableList.of(new SlotReference(originSlot.getExprId(), originSlot.getName(),
TinyIntType.INSTANCE, false, originSlot.getQualifier()));
- regularChildrenOutputs = Lists.newArrayListWithCapacity(regularChildrenOutputs.size());
children = Lists.newArrayListWithCapacity(children.size());
for (int i = 0; i < union.getArity(); i++) {
Plan child = union.child(i);
@@ -442,28 +433,36 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
} else {
project = new LogicalProject<>(newProjectOutput, child);
}
- regularChildrenOutputs.add((List) project.getOutput());
+ prunedRegularChildrenOutputs.add((List) project.getOutput());
children.add(project);
}
for (int i = 0; i < constantExprsList.size(); i++) {
prunedConstantExprsList.add(ImmutableList.of(new Alias(new TinyIntLiteral((byte) 1))));
}
} else {
- int len = extractColumnIndex.size();
+ int prunedOutputSize = extractColumnIndex.size();
for (List<NamedExpression> row : constantExprsList) {
- ImmutableList.Builder<NamedExpression> newRow = ImmutableList.builderWithExpectedSize(len);
+ ImmutableList.Builder<NamedExpression> newRow = ImmutableList.builderWithExpectedSize(prunedOutputSize);
for (int idx : extractColumnIndex) {
newRow.add(row.get(idx));
}
prunedConstantExprsList.add(newRow.build());
}
+
+ for (int childIdx = 0; childIdx < union.getRegularChildrenOutputs().size(); childIdx++) {
+ List<SlotReference> regular = Lists.newArrayListWithExpectedSize(prunedOutputSize);
+ for (int colIdx : extractColumnIndex) {
+ regular.add(regularChildrenOutputs.get(childIdx).get(colIdx));
+ }
+ prunedRegularChildrenOutputs.add(regular);
+ }
}
if (prunedOutputs.equals(originOutput) && !context.requiredSlotsIds.isEmpty()) {
return union;
} else {
return union.withNewOutputsChildrenAndConstExprsList(prunedOutputs, children,
- regularChildrenOutputs, prunedConstantExprsList.build());
+ prunedRegularChildrenOutputs, prunedConstantExprsList.build());
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/OrExpansion.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/OrExpansion.java
index cf06ee608c1..cb3067c1859 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/OrExpansion.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/OrExpansion.java
@@ -176,10 +176,13 @@ public class OrExpansion extends DefaultPlanRewriter<OrExpandsionContext> implem
}
//4. union all joins and put producers to context
List<List<SlotReference>> childrenOutputs = joins.stream()
- .map(j -> j.getOutput().stream()
+ .map(j -> j.getOutput().stream() //.map(j -> j.getOutput().stream().distinct()
.map(SlotReference.class::cast)
.collect(ImmutableList.toImmutableList()))
.collect(ImmutableList.toImmutableList());
+ //LogicalUnion union = new LogicalUnion(Qualifier.ALL,
+ // new ArrayList<>(join.getOutput().stream().distinct().collect(Collectors.toList())),
+ // childrenOutputs, ImmutableList.of(), false, joins);
LogicalUnion union = new LogicalUnion(Qualifier.ALL, new ArrayList<>(join.getOutput()),
childrenOutputs, ImmutableList.of(), false, joins);
ctx.cteProducerList.add(leftProducer);
@@ -319,8 +322,26 @@ public class OrExpansion extends DefaultPlanRewriter<OrExpandsionContext> implem
LogicalCTEConsumer left = new LogicalCTEConsumer(ctx.getStatementContext().getNextRelationId(),
leftProducer.getCteId(), "", leftProducer);
+ List<NamedExpression> leftOutput = new ArrayList<>();
+ for (Slot producerOutputSlot : leftProducer.getOutput()) {
+ for (Slot consumerSlot : left.getProducerToConsumerOutputMap().get(producerOutputSlot)) {
+ if (!leftOutput.contains(consumerSlot)) {
+ leftOutput.add(consumerSlot);
+ break;
+ }
+ }
+ }
LogicalCTEConsumer right = new LogicalCTEConsumer(ctx.getStatementContext().getNextRelationId(),
rightProducer.getCteId(), "", rightProducer);
+ List<NamedExpression> rightOutput = new ArrayList<>();
+ for (Slot producerOutputSlot : rightProducer.getOutput()) {
+ for (Slot consumerSlot : right.getProducerToConsumerOutputMap().get(producerOutputSlot)) {
+ if (!rightOutput.contains(consumerSlot)) {
+ rightOutput.add(consumerSlot);
+ break;
+ }
+ }
+ }
ctx.putCTEIdToConsumer(left);
ctx.putCTEIdToConsumer(right);
@@ -335,7 +356,10 @@ public class OrExpansion extends DefaultPlanRewriter<OrExpandsionContext> implem
LogicalJoin<? extends Plan, ? extends Plan> newJoin = new LogicalJoin<>(
JoinType.INNER_JOIN, hashCond, otherCond, join.getDistributeHint(),
- join.getMarkJoinSlotReference(), left, right, null);
+ join.getMarkJoinSlotReference(),
+ new LogicalProject<>(leftOutput, left),
+ new LogicalProject<>(rightOutput, right),
+ null);
if (newJoin.getHashJoinConjuncts().stream()
.anyMatch(equalTo -> equalTo.children().stream().anyMatch(e -> !(e instanceof Slot)))) {
Plan plan = PushDownExpressionsInHashCondition.pushDownHashExpression(newJoin);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/EagerAggRewriter.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/EagerAggRewriter.java
new file mode 100644
index 00000000000..c1fc482d83c
--- /dev/null
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/EagerAggRewriter.java
@@ -0,0 +1,625 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.rewrite.eageraggregation;
+
+import org.apache.doris.nereids.rules.analysis.NormalizeAggregate;
+import org.apache.doris.nereids.rules.rewrite.StatsDerive;
+import org.apache.doris.nereids.stats.ExpressionEstimation;
+import org.apache.doris.nereids.trees.expressions.Alias;
+import org.apache.doris.nereids.trees.expressions.CaseWhen;
+import org.apache.doris.nereids.trees.expressions.Cast;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.NamedExpression;
+import org.apache.doris.nereids.trees.expressions.Slot;
+import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction;
+import org.apache.doris.nereids.trees.expressions.functions.agg.Count;
+import org.apache.doris.nereids.trees.expressions.functions.scalar.If;
+import org.apache.doris.nereids.trees.plans.JoinType;
+import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
+import org.apache.doris.nereids.trees.plans.logical.LogicalCatalogRelation;
+import org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
+import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
+import org.apache.doris.nereids.trees.plans.logical.LogicalProject;
+import org.apache.doris.nereids.trees.plans.logical.LogicalRelation;
+import org.apache.doris.nereids.trees.plans.logical.LogicalUnion;
+import org.apache.doris.nereids.trees.plans.visitor.DefaultPlanRewriter;
+import org.apache.doris.nereids.types.DataType;
+import org.apache.doris.qe.SessionVariable;
+import org.apache.doris.statistics.ColumnStatistic;
+import org.apache.doris.statistics.Statistics;
+
+import com.google.common.collect.Lists;
+
+import java.util.ArrayList;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * eager aggregation
+ * agg[sum(t1.A) group by t1.B]
+ * ->join(t1.C=t2.D)
+ * ->T1(A, B, C)
+ * ->T2(D)
+ *
+ * =>
+ * agg[sum(x) group by t1.B]
+ * ->join(t1.C=t2.D)
+ * ->agg[sum(A) as x, group by B]
+ * ->T1(A, B, C)
+ * ->T2(D)
+ */
+public class EagerAggRewriter extends DefaultPlanRewriter<PushDownAggContext> {
+ private static final double LOWER_AGGREGATE_EFFECT_COEFFICIENT = 10000;
+ private static final double LOW_AGGREGATE_EFFECT_COEFFICIENT = 1000;
+ private static final double MEDIUM_AGGREGATE_EFFECT_COEFFICIENT = 100;
+ private final StatsDerive derive = new StatsDerive(false);
+
+ @Override
+ public Plan visitLogicalJoin(LogicalJoin<? extends Plan, ? extends Plan> join, PushDownAggContext context) {
+ boolean toLeft = false;
+ boolean toRight = false;
+ boolean pushHere = false;
+ if (context.getAggFunctions().isEmpty()) {
+ // select t1.v from t1 join t2 on t1.id = t2.id group by t1.v, t2.v
+ // if no agg function, try to push agg to the child which contains all group keys
+ // TODO: consider t1.rows/(t1.id, t1.v).ndv and t2.rows/(t2.id, t2.v).ndv to determine push target
+ if (join.left().getOutputSet().containsAll(context.getGroupKeys())) {
+ toLeft = true;
+ } else if (join.right().getOutputSet().containsAll(context.getGroupKeys())) {
+ toRight = true;
+ } else {
+ pushHere = true;
+ }
+ } else {
+ for (AggregateFunction aggFunc : context.getAggFunctions()) {
+ if (join.left().getOutputSet().containsAll(aggFunc.getInputSlots())) {
+ toLeft = true;
+ } else if (join.right().getOutputSet().containsAll(aggFunc.getInputSlots())) {
+ toRight = true;
+ } else {
+ pushHere = true;
+ }
+ }
+ }
+
+ if (pushHere || (toLeft && toRight)) {
+ if (SessionVariable.isEagerAggregationOnJoin()) {
+ return genAggregate(join, context);
+ } else {
+ return join;
+ }
+ }
+ // Do not push aggregation to the nullable side of outer joins when agg function contains case-when.
+ // CaseWhen expressions may produce non-null values from null-padded rows (e.g., WHEN col IS NULL THEN -54),
+ // so pre-aggregation before the join loses those contributions.
+ if (context.hasDecomposedAggIf || context.hasCaseWhen) {
+ JoinType joinType = join.getJoinType();
+ if (joinType.isFullOuterJoin()) {
+ return join;
+ }
+ if (joinType.isRightOuterJoin()) {
+ toLeft = false;
+ }
+ if (joinType.isLeftOuterJoin()) {
+ toRight = false;
+ }
+ if (!toLeft && !toRight && !pushHere) {
+ return join;
+ }
+ }
+
+ // Do not push count(*)/count(literal)/count(preserved_side_col) to the nullable side of outer joins.
+ // count(*) counts all physical rows, including null-extended rows from the outer join.
+ // After pushdown to the nullable side, unmatched rows produce NULL for the pre-aggregated count,
+ // and ifnull(sum(NULL), 0) = 0, which loses the count of unmatched rows.
+ // However, count(nullable_side_col) is safe to push down because for unmatched rows,
+ // nullable_side_col IS NULL, so the original count is 0, matching ifnull(sum(NULL), 0) = 0.
+ if (!join.getJoinType().isInnerJoin() && !join.getJoinType().isCrossJoin()) {
+ JoinType joinType = join.getJoinType();
+ for (AggregateFunction aggFunc : context.getAggFunctions()) {
+ if (aggFunc instanceof Count) {
+ Set<Slot> countInputSlots = aggFunc.getInputSlots();
+ // Determine which side is nullable
+ boolean leftIsNullable = joinType.isRightOuterJoin() || joinType.isFullOuterJoin();
+ boolean rightIsNullable = joinType.isLeftOuterJoin() || joinType.isFullOuterJoin();
+ // Check if we're pushing to a nullable side without referencing its columns
+ if (toLeft && leftIsNullable) {
+ boolean hasLeftInput = countInputSlots.stream()
+ .anyMatch(slot -> join.left().getOutputSet().contains(slot));
+ if (!hasLeftInput) {
+ toLeft = false;
+ }
+ }
+ if (toRight && rightIsNullable) {
+ boolean hasRightInput = countInputSlots.stream()
+ .anyMatch(slot -> join.right().getOutputSet().contains(slot));
+ if (!hasRightInput) {
+ toRight = false;
+ }
+ }
+ }
+ }
+ if (!toLeft && !toRight && !pushHere) {
+ return join;
+ }
+ }
+
+ List<SlotReference> joinConditionSlots;
+ List<SlotReference> childGroupByKeys = new ArrayList<>();
+ if (toLeft) {
+ joinConditionSlots = getJoinConditionsInputSlotsFromOneSide(join, join.left());
+ for (SlotReference key : context.getGroupKeys()) {
+ if (join.left().getOutputSet().containsAll(key.getInputSlots())) {
+ childGroupByKeys.add(key);
+ }
+ }
+ } else {
+ joinConditionSlots = getJoinConditionsInputSlotsFromOneSide(join, join.right());
+ for (SlotReference key : context.getGroupKeys()) {
+ if (join.right().getOutputSet().containsAll(key.getInputSlots())) {
+ childGroupByKeys.add(key);
+ }
+ }
+ }
+
+ for (SlotReference slot : joinConditionSlots) {
+ if (!childGroupByKeys.contains(slot)) {
+ childGroupByKeys.add(slot);
+ }
+ }
+
+ PushDownAggContext childContext = context.withGroupKeys(childGroupByKeys);
+ if (!childContext.isValid()) {
+ return join;
+ }
+ Statistics stats = join.right().getStats();
+ if (stats == null) {
+ stats = join.right().accept(derive, new StatsDerive.DeriveContext());
+ }
+ if (stats.getRowCount() > PushDownAggContext.BIG_JOIN_BUILD_SIZE
+ || SessionVariable.getEagerAggregationMode() > 0) {
+ childContext = childContext.passThroughBigJoin();
+ }
+ if (toLeft) {
+ Plan newLeft = join.left().accept(this, childContext);
+ if (newLeft != join.left()) {
+ return join.withChildren(newLeft, join.right());
+ }
+ } else {
+ Plan newRight = join.right().accept(this, childContext);
+ if (newRight != join.right()) {
+ return join.withChildren(join.left(), newRight);
+ }
+ }
+ return join;
+ }
+
+ private List<SlotReference> getJoinConditionsInputSlotsFromOneSide(
+ LogicalJoin<? extends Plan, ? extends Plan> join,
+ Plan side) {
+ List<SlotReference> oneSideSlots = new ArrayList<>();
+ for (Expression condition : join.getHashJoinConjuncts()) {
+ for (Slot slot : condition.getInputSlots()) {
+ if (side.getOutputSet().contains(slot)) {
+ oneSideSlots.add((SlotReference) slot);
+ }
+ }
+ }
+ for (Expression condition : join.getOtherJoinConjuncts()) {
+ for (Slot slot : condition.getInputSlots()) {
+ if (side.getOutputSet().contains(slot)) {
+ oneSideSlots.add((SlotReference) slot);
+ }
+ }
+ }
+ return oneSideSlots;
+ }
+
+ private PushDownAggContext createContextFromProject(
+ LogicalProject<? extends Plan> project,
+ PushDownAggContext context) {
+ /*
+ * context: sum(a) groupBy(y+z as x, l)
+ * proj: b+c as a, u+v as y, m+n as l
+ * newContext: sum(b+c), groupBy((u+v)+z as x, m+n as l)
+ */
+
+ List<SlotReference> groupKeys = new ArrayList<>();
+ for (SlotReference key : context.getGroupKeys()) {
+ groupKeys.addAll(
+ project.pushDownExpressionPastProject(key).getInputSlots()
+ .stream().map(slot -> (SlotReference) slot).collect(Collectors.toList()));
+ }
+
+ List<AggregateFunction> aggFunctions = new ArrayList<>();
+ Map<AggregateFunction, Alias> aliasMap = new IdentityHashMap<>();
+ for (AggregateFunction aggFunc : context.getAggFunctions()) {
+ AggregateFunction newAggFunc = (AggregateFunction) project.pushDownExpressionPastProject(aggFunc);
+ Alias alias = context.getAliasMap().get(aggFunc);
+ aliasMap.put(newAggFunc, (Alias) alias.withChildren(newAggFunc));
+ aggFunctions.add(newAggFunc);
+ }
+ // After pushing expressions past the project, the agg functions may now
+ // contain If/CaseWhen that were hidden behind slot references before.
+ // e.g. count(#slot) where #slot = if(cond, a, b) in the project.
+ // We must re-check and update hasCaseWhen accordingly.
+ boolean newHasCaseWhen = context.hasCaseWhen;
+ if (!newHasCaseWhen) {
+ for (AggregateFunction aggFunc : aggFunctions) {
+ if (aggFunc.anyMatch(e -> e instanceof CaseWhen || e instanceof If)) {
+ newHasCaseWhen = true;
+ break;
+ }
+ }
+ }
+ return new PushDownAggContext(aggFunctions, groupKeys, aliasMap,
+ context.getCascadesContext(), context.isPassThroughBigJoin(),
+ context.hasDecomposedAggIf, newHasCaseWhen);
+ }
+
+ private boolean canPushThroughProject(LogicalProject<? extends Plan> project, PushDownAggContext context) {
+ for (SlotReference slot : context.getGroupKeys()) {
+ if (!project.getOutputSet().contains(slot)) {
+ SessionVariable.throwAnalysisExceptionWhenFeDebug("eager agg failed: can not find group key("
+ + slot + ") in " + project);
+ return false;
+ }
+ }
+ for (Slot slot : context.getAggFunctionsInputSlots()) {
+ if (!project.getOutputSet().contains(slot)) {
+ SessionVariable.throwAnalysisExceptionWhenFeDebug("eager agg failed: can not find aggFunc slot("
+ + slot + ") in " + project);
+ return false;
+ }
+ }
+
+ // push sum(A) through project(x, x+y as A)
+ // if x is not used as group key, do not push through
+ for (Slot slot : context.getAggFunctionsInputSlots()) {
+ for (NamedExpression prj : project.getProjects()) {
+ if (prj instanceof Alias && prj.getExprId().equals(slot.getExprId())) {
+ if (prj.getInputSlots().stream()
+ .anyMatch(
+ s -> project.getOutputSet().contains(s)
+ && !context.getGroupKeys().contains(s))) {
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ private Plan alignUnionChildrenDataType(Plan child, PushDownAggContext context) {
+ int outputSize = child.getOutput().size();
+ List<DataType> outputDataType = Lists.newArrayListWithExpectedSize(outputSize);
+ outputDataType.addAll(context.getAggFunctions().stream()
+ .map(func -> context.getAliasMap().get(func).getDataType()).collect(Collectors.toList()));
+ outputDataType.addAll(context.getGroupKeys().stream().map(s -> s.getDataType()).collect(Collectors.toList()));
+ List<NamedExpression> projection = Lists.newArrayListWithExpectedSize(outputSize);
+ boolean needProject = false;
+ for (int colIdx = 0; colIdx < outputSize; colIdx++) {
+ SlotReference slot = (SlotReference) child.getOutput().get(colIdx);
+ if (!slot.getDataType().equals(outputDataType.get(colIdx))) {
+ projection.add(new Alias(new Cast(slot, outputDataType.get(colIdx))));
+ needProject = true;
+ } else {
+ projection.add(slot);
+ }
+ }
+ if (needProject) {
+ return new LogicalProject<Plan>(projection, child);
+ } else {
+ return child;
+ }
+ }
+
+ @Override
+ public Plan visitLogicalUnion(LogicalUnion union, PushDownAggContext context) {
+ if (!union.getConstantExprsList().isEmpty()) {
+ return union;
+ }
+
+ if (!union.getOutputs().stream().allMatch(e -> e instanceof SlotReference)) {
+ return union;
+ }
+ List<Plan> newChildren = Lists.newArrayList();
+ List<PushDownAggContext> childrenContext = new ArrayList<>();
+ /*
+ if any child can not push, do not push
+ example
+ agg(output=[sum(a),min(a)], groupkey=[b])
+ ->union(a, b)
+ ->child1(a1, b1)
+ ->child2(a2, b2)
+ if agg pushdown through child1, newChild1 output is (sum(a1), min(a1) b1)
+ but if agg can not pushdown through child2, the output of child2 is (a2, b2).
+ Output size of newChild1 and child2 are different
+ */
+ boolean changed = false;
+ for (int idx = 0; idx < union.children().size(); idx++) {
+ Plan child = union.children().get(idx);
+ final int childIdx = idx;
+ List<AggregateFunction> aggFunctionsForChild = new ArrayList<>();
+ IdentityHashMap<AggregateFunction, Alias> aliasMapForChild = new IdentityHashMap<>();
+ for (AggregateFunction func : context.getAggFunctions()) {
+ AggregateFunction newFunc = (AggregateFunction) union.pushDownExpressionPastSetOperator(func, childIdx);
+ aggFunctionsForChild.add(newFunc);
+ Alias alias = context.getAliasMap().get(func);
+ // aliasForChild should have its own ExprId
+ Alias aliasForChild = new Alias(newFunc, alias.getName(), alias.getQualifier());
+ aliasMapForChild.put(newFunc, aliasForChild);
+ }
+
+ List<SlotReference> groupKeysForChild = context.getGroupKeys().stream()
+ .map(slot -> (SlotReference) union.pushDownExpressionPastSetOperator(slot, childIdx))
+ .collect(Collectors.toList());
+ PushDownAggContext contextForChild = new PushDownAggContext(aggFunctionsForChild, groupKeysForChild,
+ aliasMapForChild, context.getCascadesContext(),
+ context.isPassThroughBigJoin(), context.hasDecomposedAggIf, context.hasCaseWhen);
+ childrenContext.add(contextForChild);
+ if (contextForChild.isValid()) {
+ Plan newChild = child.accept(this, contextForChild);
+ if (newChild != child) {
+ newChildren.add(newChild);
+ changed = true;
+ } else {
+ changed = false;
+ break;
+ }
+ } else {
+ // child(idx) cannot be rewritten, stop
+ break;
+ }
+ }
+ if (changed) {
+ for (int idx = 0; idx < union.children().size(); idx++) {
+ // all children need align data type
+ Plan newChild = alignUnionChildrenDataType(newChildren.get(idx), context);
+ newChildren.set(idx, newChild);
+ }
+ List<List<SlotReference>> newRegularChildrenOutputs = Lists.newArrayListWithExpectedSize(union.arity());
+ for (int childIdx = 0; childIdx < union.arity(); childIdx++) {
+ newRegularChildrenOutputs.add(
+ newChildren.get(childIdx).getOutput().stream()
+ .map(s -> (SlotReference) s).collect(Collectors.toList()));
+ }
+
+ List<NamedExpression> newOutput = Lists.newArrayList();
+ for (AggregateFunction func : context.getAggFunctions()) {
+ Alias alias = context.getAliasMap().get(func);
+ if (alias == null) {
+ SessionVariable.throwAnalysisExceptionWhenFeDebug("push down agg failed. union: " + union
+ + " context: " + context);
+ return union;
+ }
+ newOutput.add(alias.toSlot());
+ }
+ newOutput.addAll(context.getGroupKeys());
+ LogicalUnion newUnion = (LogicalUnion) union
+ .withChildrenAndOutputs(newChildren, newOutput, newRegularChildrenOutputs);
+ return newUnion;
+ } else {
+ return union;
+ }
+ }
+
+ @Override
+ public Plan visitLogicalProject(LogicalProject<? extends Plan> project, PushDownAggContext context) {
+ if (project.child() instanceof LogicalCatalogRelation
+ || (project.child() instanceof LogicalFilter
+ && project.child().child(0) instanceof LogicalCatalogRelation)) {
+ // project
+ // --> scan
+ // =>
+ // aggregate
+ // --> project
+ // --> scan
+ return genAggregate(project, context);
+ }
+
+ if (!canPushThroughProject(project, context)) {
+ return genAggregate(project, context);
+ }
+
+ PushDownAggContext newContext = createContextFromProject(project, context);
+ if (!newContext.isValid()) {
+ return project;
+ }
+ Plan newChild = project.child().accept(this, newContext);
+ if (newChild != project.child()) {
+ /*
+ * agg[sum(a), groupBy(b)]
+ * -> proj(a, b1+b2 as b)
+ * -> join(c = d)
+ * -> any(a, b1, b2, c,...)
+ * -> any(d, ...)
+ * =>
+ * agg[sum(x), groupBy(b)]
+ * -> proj(x, b1+b2 as b)
+ * -> join(c=d)
+ * ->agg[sum(a) as x, groupBy(b1, b2, c)]
+ * ->proj(a, b1, b2, c, ...)
+ * -> any(a, b1, b2, c)
+ * -> any(d, ...)
+ */
+ List<NamedExpression> newProjections = new ArrayList<>();
+ //for (Alias alias : context.getAliasMap().values()) {
+ // newProjections.add(alias.toSlot());
+ //}
+ for (AggregateFunction aggFunc : context.getAggFunctions()) {
+ newProjections.add(context.getAliasMap().get(aggFunc).toSlot());
+ }
+ for (SlotReference slot : context.getGroupKeys()) {
+ boolean valid = false;
+ for (NamedExpression ne : project.getProjects()) {
+ if (ne.toSlot().getExprId().equals(slot.getExprId())) {
+ valid = true;
+ newProjections.add(ne);
+ break;
+ }
+ }
+ if (!valid) {
+ SessionVariable.throwAnalysisExceptionWhenFeDebug(
+ "push agg failed. slot: " + "not found in " + project);
+ return project;
+ }
+ }
+ LogicalProject result = new LogicalProject(newProjections, newChild);
+ return result;
+ }
+
+ return project;
+ }
+
+ @Override
+ public Plan visitLogicalAggregate(LogicalAggregate<? extends Plan> agg, PushDownAggContext context) {
+ return agg;
+ }
+
+ @Override
+ public Plan visitLogicalFilter(LogicalFilter<? extends Plan> filter, PushDownAggContext context) {
+ return genAggregate(filter, context);
+ }
+
+ @Override
+ public Plan visitLogicalRelation(LogicalRelation relation, PushDownAggContext context) {
+ return genAggregate(relation, context);
+ }
+
+ private Plan genAggregate(Plan child, PushDownAggContext context) {
+ if (context.isValid() && checkStats(child, context)) {
+ List<NamedExpression> aggOutputExpressions = new ArrayList<>();
+ for (AggregateFunction func : context.getAggFunctions()) {
+ aggOutputExpressions.add(context.getAliasMap().get(func));
+ }
+ aggOutputExpressions.addAll(context.getGroupKeys());
+ LogicalAggregate genAgg = new LogicalAggregate(context.getGroupKeys(), aggOutputExpressions, child);
+ NormalizeAggregate normalizeAggregate = new NormalizeAggregate();
+ return normalizeAggregate.normalizeAgg(genAgg, Optional.empty(),
+ context.getCascadesContext());
+ } else {
+ return child;
+ }
+ }
+
+ private boolean checkStats(Plan plan, PushDownAggContext context) {
+ int mode = SessionVariable.getEagerAggregationMode();
+ if (mode < 0) {
+ return false;
+ }
+
+ if (mode > 0) {
+ // when mode=1, any join is regarded as big join in order to
+ // push down aggregation through at least one join
+ return context.isPassThroughBigJoin();
+ }
+
+ if (!context.isPassThroughBigJoin() && !context.hasDecomposedAggIf) {
+ return false;
+ }
+
+ Statistics stats = plan.getStats();
+ if (stats == null) {
+ stats = plan.accept(derive, new StatsDerive.DeriveContext());
+ }
+ if (stats.getRowCount() <= 0) {
+ return false;
+ }
+
+ List<ColumnStatistic> groupKeysStats = new ArrayList<>();
+
+ List<ColumnStatistic> lower = Lists.newArrayList();
+ List<ColumnStatistic> medium = Lists.newArrayList();
+ List<ColumnStatistic> high = Lists.newArrayList();
+
+ List<ColumnStatistic>[] cards = new List[] { lower, medium, high };
+
+ for (NamedExpression key : context.getGroupKeys()) {
+ ColumnStatistic colStats = ExpressionEstimation.INSTANCE.estimate(key, stats);
+ if (colStats.isUnKnown) {
+ return false;
+ }
+ if (stats.getRowCount() * 0.9 <= colStats.ndv) {
+ return false;
+ }
+ groupKeysStats.add(colStats);
+ cards[groupByCardinality(colStats, stats.getRowCount())].add(colStats);
+ }
+
+ double lowerCartesian = 1.0;
+ for (ColumnStatistic colStats : lower) {
+ lowerCartesian = lowerCartesian * colStats.ndv;
+ }
+
+ // pow(row_count/20, a half of lower column size)
+ double lowerUpper = Math.max(stats.getRowCount() / 20, 1);
+ lowerUpper = Math.pow(lowerUpper, Math.max(lower.size() / 2, 1));
+
+ if (high.isEmpty() && (lower.size() + medium.size()) <= 2) {
+ return true;
+ }
+
+ if (high.isEmpty() && medium.isEmpty()) {
+ if (lower.size() == 1 && lowerCartesian * 20 <= stats.getRowCount()) {
+ return true;
+ } else if (lower.size() == 2 && lowerCartesian * 7 <= stats.getRowCount()) {
+ return true;
+ } else if (lower.size() <= 3 && lowerCartesian * 20 <= stats.getRowCount() && lowerCartesian < lowerUpper) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ if (high.size() >= 2 || medium.size() > 2 || (high.size() == 1 && !medium.isEmpty())) {
+ return false;
+ }
+
+ // 3. Extremely low cardinality for lower with at most one medium or high.
+ double lowerCartesianLowerBound = stats.getRowCount() / LOWER_AGGREGATE_EFFECT_COEFFICIENT;
+ if (high.size() + medium.size() == 1 && lower.size() <= 2 && lowerCartesian <= lowerCartesianLowerBound) {
+ return true;
+ }
+
+ return false;
+ }
+
+ // high(2): row_count / cardinality < MEDIUM_AGGREGATE_EFFECT_COEFFICIENT
+ // medium(1): row_count / cardinality >= MEDIUM_AGGREGATE_EFFECT_COEFFICIENT and
+ // < LOW_AGGREGATE_EFFECT_COEFFICIENT
+ // lower(0): row_count / cardinality >= LOW_AGGREGATE_EFFECT_COEFFICIENT
+ private int groupByCardinality(ColumnStatistic colStats, double rowCount) {
+ if (rowCount == 0 || colStats.ndv * MEDIUM_AGGREGATE_EFFECT_COEFFICIENT > rowCount) {
+ return 2;
+ } else if (colStats.ndv * MEDIUM_AGGREGATE_EFFECT_COEFFICIENT <= rowCount
+ && colStats.ndv * LOW_AGGREGATE_EFFECT_COEFFICIENT > rowCount) {
+ return 1;
+ } else if (colStats.ndv * LOW_AGGREGATE_EFFECT_COEFFICIENT <= rowCount) {
+ return 0;
+ }
+ return 2;
+ }
+}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggContext.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggContext.java
new file mode 100644
index 00000000000..17686d006a7
--- /dev/null
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggContext.java
@@ -0,0 +1,144 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.rewrite.eageraggregation;
+
+import org.apache.doris.nereids.CascadesContext;
+import org.apache.doris.nereids.trees.expressions.Alias;
+import org.apache.doris.nereids.trees.expressions.Slot;
+import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * PushDownAggContext
+ */
+public class PushDownAggContext {
+ public static final int BIG_JOIN_BUILD_SIZE = 400_000;
+ // count(if(...)): if(...) push down as a whole
+ // sum/min/max(if(truePart, elsePart)): if(...) can be split to sum(truePart) and sum(elsePart)
+ public final boolean hasDecomposedAggIf;
+ // When aggFunc(if(...)) is present, pushing down the null-supplemented side of the outer join is avoided.
+ // This is because null values are highly error-prone,
+ // so the push-down operation is not performed during hashCaseWhen.
+ public final boolean hasCaseWhen;
+ private final List<AggregateFunction> aggFunctions;
+ private final List<SlotReference> groupKeys;
+ private final HashMap<AggregateFunction, Alias> aliasMap;
+ private final Set<Slot> aggFunctionsInputSlots;
+
+ // cascadesContext is used for normalizeAgg
+ private final CascadesContext cascadesContext;
+
+ private final boolean passThroughBigJoin;
+
+ /**
+ * constructor
+ */
+ public PushDownAggContext(List<AggregateFunction> aggFunctions,
+ List<SlotReference> groupKeys, Map<AggregateFunction, Alias> aliasMap, CascadesContext cascadesContext,
+ boolean passThroughBigJoin, boolean hasDecomposedAggIf, boolean hasCaseWhen) {
+ this.groupKeys = groupKeys.stream().distinct().collect(Collectors.toList());
+ this.aggFunctions = ImmutableList.copyOf(aggFunctions);
+ this.cascadesContext = cascadesContext;
+
+ HashMap<AggregateFunction, Alias> builtAliasMap = new HashMap<>();
+ if (aliasMap == null) {
+ for (AggregateFunction aggFunction : this.aggFunctions) {
+ builtAliasMap.put(aggFunction, new Alias(aggFunction, aggFunction.getName()));
+ }
+ } else {
+ for (AggregateFunction aggFunction : this.aggFunctions) {
+ Alias alias = aliasMap.get(aggFunction);
+ if (alias == null) {
+ alias = new Alias(aggFunction, aggFunction.getName());
+ }
+ builtAliasMap.put(aggFunction, alias);
+ }
+ }
+ this.aliasMap = builtAliasMap;
+
+ this.aggFunctionsInputSlots = aggFunctions.stream()
+ .flatMap(aggFunction -> aggFunction.getInputSlots().stream())
+ .filter(Slot.class::isInstance)
+ .collect(ImmutableSet.toImmutableSet());
+ this.passThroughBigJoin = passThroughBigJoin;
+ this.hasDecomposedAggIf = hasDecomposedAggIf;
+ this.hasCaseWhen = hasCaseWhen;
+ }
+
+ /**
+ * check validation
+ * @return true, if groupKeys is not empty and no group by key is in aggFunctionsInputSlots
+ */
+ public boolean isValid() {
+ return !groupKeys.isEmpty()
+ && !groupKeys.stream().anyMatch(s -> aggFunctionsInputSlots.contains(s));
+ }
+
+ public PushDownAggContext passThroughBigJoin() {
+ return new PushDownAggContext(aggFunctions, groupKeys, aliasMap, cascadesContext,
+ true, hasDecomposedAggIf, hasCaseWhen);
+ }
+
+ public HashMap<AggregateFunction, Alias> getAliasMap() {
+ return aliasMap;
+ }
+
+ public List<AggregateFunction> getAggFunctions() {
+ return aggFunctions;
+ }
+
+ public List<SlotReference> getGroupKeys() {
+ return groupKeys;
+ }
+
+ public PushDownAggContext withGroupKeys(List<SlotReference> groupKeys) {
+ return new PushDownAggContext(aggFunctions, groupKeys, aliasMap,
+ cascadesContext, passThroughBigJoin, hasDecomposedAggIf, hasCaseWhen);
+ }
+
+ public Set<Slot> getAggFunctionsInputSlots() {
+ return aggFunctionsInputSlots;
+ }
+
+ public CascadesContext getCascadesContext() {
+ return cascadesContext;
+ }
+
+ public boolean isPassThroughBigJoin() {
+ return passThroughBigJoin;
+ }
+
+ @Override
+ public String toString() {
+ return "PushDownAggContext{"
+ + "aggFunctions=" + aggFunctions
+ + ", groupKeys=" + groupKeys
+ + ", aliasMap=" + aliasMap
+ + ", passThroughBigJoin=" + passThroughBigJoin
+ + '}';
+ }
+}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggregation.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggregation.java
new file mode 100644
index 00000000000..d92bc91e61c
--- /dev/null
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggregation.java
@@ -0,0 +1,319 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.rewrite.eageraggregation;
+
+import org.apache.doris.nereids.jobs.JobContext;
+import org.apache.doris.nereids.rules.analysis.NormalizeAggregate;
+import org.apache.doris.nereids.rules.rewrite.AdjustNullable;
+import org.apache.doris.nereids.trees.expressions.CaseWhen;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.NamedExpression;
+import org.apache.doris.nereids.trees.expressions.Slot;
+import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.expressions.functions.Function;
+import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction;
+import org.apache.doris.nereids.trees.expressions.functions.agg.Count;
+import org.apache.doris.nereids.trees.expressions.functions.agg.Max;
+import org.apache.doris.nereids.trees.expressions.functions.agg.Min;
+import org.apache.doris.nereids.trees.expressions.functions.agg.RollUpTrait;
+import org.apache.doris.nereids.trees.expressions.functions.agg.Sum;
+import org.apache.doris.nereids.trees.expressions.functions.scalar.If;
+import org.apache.doris.nereids.trees.expressions.functions.scalar.Nvl;
+import org.apache.doris.nereids.trees.expressions.literal.BigIntLiteral;
+import org.apache.doris.nereids.trees.expressions.literal.NullLiteral;
+import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
+import org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
+import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
+import org.apache.doris.nereids.trees.plans.logical.LogicalProject;
+import org.apache.doris.nereids.trees.plans.logical.LogicalRelation;
+import org.apache.doris.nereids.trees.plans.logical.LogicalUnion;
+import org.apache.doris.nereids.trees.plans.visitor.CustomRewriter;
+import org.apache.doris.nereids.trees.plans.visitor.DefaultPlanRewriter;
+import org.apache.doris.nereids.util.ExpressionUtils;
+import org.apache.doris.qe.SessionVariable;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * push down aggregation
+ */
+public class PushDownAggregation extends DefaultPlanRewriter<JobContext> implements CustomRewriter {
+ private static final Logger LOG = LoggerFactory.getLogger(PushDownAggregation.class);
+
+ public final EagerAggRewriter writer = new EagerAggRewriter();
+
+ private final Set<Class> pushDownAggFunctionSet = Sets.newHashSet(
+ Count.class,
+ Sum.class,
+ Max.class,
+ Min.class);
+
+ private final Set<Class> acceptNodeType = Sets.newHashSet(
+ LogicalUnion.class,
+ LogicalProject.class,
+ LogicalFilter.class,
+ LogicalRelation.class,
+ LogicalJoin.class);
+
+ @Override
+ public Plan rewriteRoot(Plan plan, JobContext jobContext) {
+ if (SessionVariable.isFeDebug()) {
+ try {
+ new AdjustNullable(false).rewriteRoot(plan, null);
+ } catch (Exception e) {
+ LOG.warn("(PushDownAggregation) input plan has nullable problem", e);
+ return plan;
+ }
+ }
+ int mode = SessionVariable.getEagerAggregationMode();
+ if (mode < 0) {
+ return plan;
+ } else {
+ Plan result = plan.accept(this, jobContext);
+ if (SessionVariable.isFeDebug()) {
+ result = new AdjustNullable(true).rewriteRoot(result, null);
+ }
+ return result;
+ }
+ }
+
+ @Override
+ public Plan visitLogicalAggregate(LogicalAggregate<? extends Plan> agg, JobContext context) {
+ Plan newChild = agg.child().accept(this, context);
+ if (newChild != agg.child()) {
+ return agg.withChildren(newChild);
+ }
+
+ if (agg.getSourceRepeat().isPresent()) {
+ return agg;
+ }
+
+ List<SlotReference> groupKeys = new ArrayList<>();
+ for (Expression groupKey : agg.getGroupByExpressions()) {
+ if (groupKey instanceof SlotReference) {
+ groupKeys.add((SlotReference) groupKey);
+ } else {
+ SessionVariable.throwAnalysisExceptionWhenFeDebug(
+ "PushDownAggregation failed: agg is not normalized\n "
+ + agg.treeString());
+ return agg;
+ }
+ }
+
+ Set<AggregateFunction> aggFunctions = Sets.newHashSet();
+ boolean hasDecomposedAggIf = false;
+ boolean hasCaseWhen = false;
+ Map<NamedExpression, List<AggregateFunction>> aggFunctionsForOutputExpressions = Maps.newHashMap();
+ for (NamedExpression aggOutput : agg.getOutputExpressions()) {
+ List<AggregateFunction> funcs = Lists.newArrayList();
+ aggFunctionsForOutputExpressions.put(aggOutput, funcs);
+ for (Object obj : aggOutput.collect(AggregateFunction.class::isInstance)) {
+ AggregateFunction aggFunction = (AggregateFunction) obj;
+ if (aggFunction.isDistinct()) {
+ return agg;
+ }
+ if (pushDownAggFunctionSet.contains(aggFunction.getClass())) {
+ // CaseWhen and If (which CASE WHEN is normalized into) must both be checked.
+ // When an agg function contains an If/CaseWhen whose condition tests IS NULL
+ // (e.g. count(if(col IS NULL, value, NULL))), pushing it to the nullable side
+ // of an outer join produces wrong results: null-extended rows make "col IS NULL"
+ // TRUE at the top level, but the pre-aggregated count slot becomes NULL after
+ // null-extension, and ifnull(sum(NULL), 0) = 0 instead of the correct 1.
+ if (!hasCaseWhen && aggFunction.anyMatch(e -> e instanceof CaseWhen || e instanceof If)) {
+ hasCaseWhen = true;
+ }
+ if (aggFunction.arity() > 0 && aggFunction.child(0) instanceof If
+ && !(aggFunction instanceof Count)) {
+ // Decompose Sum/Max/Min(If(cond, a, b)) into separate agg functions.
+ // Count(If(...)) is NOT decomposed here because the top-level
+ // replacement (Count->Sum rollup) cannot match the decomposed
+ // Count(a)/Count(b) as sub-expressions of the original Count(If(cond,a,b)).
+ // Count(If(...)) is pushed down as-is and rolled up normally.
+ If body = (If) (aggFunction).child(0);
+ Set<Slot> valueSlots = Sets.newHashSet(body.getTrueValue().getInputSlots());
+ valueSlots.addAll(body.getFalseValue().getInputSlots());
+ if (body.getCondition().getInputSlots().stream().anyMatch(s -> valueSlots.contains(s))) {
+ // do not push down sum(if a then a else b)
+ return agg;
+ }
+ AggregateFunction aggTrue = (AggregateFunction) aggFunction.withChildren(body.getTrueValue());
+ aggFunctions.add(aggTrue);
+ funcs.add(aggTrue);
+ if (!(body.getFalseValue() instanceof NullLiteral)) {
+ AggregateFunction aggFalse =
+ (AggregateFunction) aggFunction.withChildren(body.getFalseValue());
+ aggFunctions.add(aggFalse);
+ funcs.add(aggFalse);
+ }
+ groupKeys.addAll(body.getCondition().getInputSlots()
+ .stream().map(slot -> (SlotReference) slot).collect(Collectors.toList()));
+ hasDecomposedAggIf = true;
+ } else {
+ aggFunctions.add(aggFunction);
+ funcs.add(aggFunction);
+ }
+
+ } else {
+ return agg;
+ }
+ }
+ }
+
+ groupKeys = groupKeys.stream().distinct().collect(Collectors.toList());
+ if (!checkSubTreePattern(agg.child())) {
+ return agg;
+ }
+
+ PushDownAggContext pushDownContext = new PushDownAggContext(new ArrayList<>(aggFunctions),
+ groupKeys, null, context.getCascadesContext(), false, hasDecomposedAggIf, hasCaseWhen);
+ if (!pushDownContext.isValid()) {
+ return agg;
+ }
+ try {
+ Plan child = agg.child().accept(writer, pushDownContext);
+ if (child != agg.child()) {
+ // agg has been pushed down, rewrite agg output expressions
+ // before: agg[sum(A), by (B)]
+ // ->join(C=D)
+ // ->scan(T1[A...])
+ // ->scan(T2)
+ // after: agg[sum(x), by(B)]
+ // ->join(C=D)
+ // ->agg[sum(A) as x, by(B,C)]
+ // ->scan(T1[A...])
+ // ->scan(T2)
+ List<NamedExpression> newOutputExpressions = new ArrayList<>();
+ //Map<AggregateFunction, AggregateFunction> replaceMap = new HashMap<>();
+ //for (AggregateFunction aggFunc : pushDownContext.getAliasMap().keySet()) {
+ // Alias alias = pushDownContext.getAliasMap().get(aggFunc);
+ // replaceMap.put(aggFunc, (AggregateFunction) aggFunc.withChildren((Expression) alias.toSlot()));
+ //}
+
+ for (NamedExpression ne : agg.getOutputExpressions()) {
+ if (ne instanceof SlotReference) {
+ newOutputExpressions.add(ne);
+ } else {
+ // every expression has its own replaceMap
+ // aggregation(output=[min(A), sum(A)])
+ // --> join
+ // -> T1 [A ...]
+ // -> T2 [...]
+ // =>
+ // aggregation(output=[min(minA), sum(sumA)])
+ // --> join
+ // -> agg(output=[min(A) as minA, sum(A) as sumA])
+ // -> T1 [A ...]
+ // -> T2 [...]
+ // for min(A), replaceMap: A->minA
+ // for sum(A), replaceMap: A->sumA
+ // for count(A), replaceMap: count(A)->sum(countA), because count needs rollup to sum
+ Map<Expression, Expression> replaceMap = new HashMap<>();
+ List<AggregateFunction> relatedAggFunc = aggFunctionsForOutputExpressions.get(ne);
+ for (AggregateFunction func : relatedAggFunc) {
+ Slot pushedDownSlot = pushDownContext.getAliasMap().get(func).toSlot();
+ if (func instanceof Count) {
+ // For count(A), after pushdown we have count(A) as x,
+ // and the top agg should use sum(x) instead of count(x).
+ // Wrap with ifnull(..., 0) because COUNT never returns NULL,
+ // but after pushdown across an outer join, the intermediate count
+ // slot can be NULL (null-extended), making sum(NULL) = NULL.
+ Function rollUpFunc = ((RollUpTrait) func).constructRollUp(pushedDownSlot);
+ replaceMap.put(func, new Nvl(rollUpFunc, new BigIntLiteral(0)));
+ } else if (func.arity() > 0) {
+ // For sum/max/min, replace the child expression with the pushed down slot
+ replaceMap.put(func.child(0), pushedDownSlot);
+ }
+ }
+ NamedExpression replaceAliasExpr = (NamedExpression) ExpressionUtils.replace(ne, replaceMap);
+ replaceAliasExpr = (NamedExpression) ExpressionUtils.rebuildSignature(replaceAliasExpr);
+ newOutputExpressions.add(replaceAliasExpr);
+ }
+ }
+ LogicalAggregate<Plan> eagerAgg =
+ agg.withAggOutputChild(newOutputExpressions, child);
+ NormalizeAggregate normalizeAggregate = new NormalizeAggregate();
+ return normalizeAggregate.normalizeAgg(eagerAgg, Optional.empty(),
+ context.getCascadesContext());
+ }
+ } catch (RuntimeException e) {
+ String msg = "PushDownAggregation failed: " + e.getMessage() + "\n" + agg.treeString();
+ LOG.info(msg, e);
+ SessionVariable.throwAnalysisExceptionWhenFeDebug(msg);
+ }
+ return agg;
+ }
+
+ private boolean checkSubTreePattern(Plan root) {
+ return containsPushDownJoin(root)
+ && checkPlanNodeType(root);
+ }
+
+ private boolean containsPushDownJoin(Plan root) {
+ if (root instanceof LogicalJoin && !((LogicalJoin) root).isMarkJoin()) {
+ return true;
+ }
+ if (root.children().isEmpty()) {
+ return false;
+ }
+ return root.children().stream().anyMatch(this::containsPushDownJoin);
+ }
+
+ private boolean checkPlanNodeType(Plan root) {
+ boolean accepted = acceptNodeType.stream()
+ .anyMatch(clazz -> clazz.isAssignableFrom(root.getClass()));
+ if (!accepted) {
+ return false;
+ }
+ for (Plan child : root.children()) {
+ if (!checkPlanNodeType(child)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/ExpressionEstimation.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/ExpressionEstimation.java
index a6e620b8efc..020c0dd3d6a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/ExpressionEstimation.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/ExpressionEstimation.java
@@ -120,7 +120,7 @@ public class ExpressionEstimation extends ExpressionVisitor<ColumnStatistic, Sta
public static final Logger LOG = LogManager.getLogger(ExpressionEstimation.class);
public static final long DAYS_FROM_0_TO_1970 = 719528;
public static final long DAYS_FROM_0_TO_9999 = 3652424;
- private static final ExpressionEstimation INSTANCE = new ExpressionEstimation();
+ public static final ExpressionEstimation INSTANCE = new ExpressionEstimation();
/**
* returned columnStat is newly created or a copy of stats
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java
index 16d7740cf9c..ea472071678 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java
@@ -155,4 +155,8 @@ public abstract class BoundFunction extends Function implements ComputeSignature
});
}
}
+
+ //public void rebuildSignature() {
+ // this.signatureCache = buildSignatureCache(null);
+ //}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java
index a8860596299..409f9a2ee11 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java
@@ -126,7 +126,7 @@ public class LogicalFileScan extends LogicalCatalogRelation implements SupportPr
@Override
public String toString() {
- return Utils.toSqlStringSkipNull("LogicalFileScan",
+ return Utils.toSqlStringSkipNull("LogicalFileScan[" + id.asInt() + "]",
"qualified", qualifiedName(),
"alias", tableAlias,
"output", getOutput(),
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
index bbcc44a38fc..11f5d02c9f2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
@@ -304,7 +304,7 @@ public class LogicalOlapScan extends LogicalCatalogRelation implements OlapScan,
@Override
public String toString() {
- return Utils.toSqlStringSkipNull("LogicalOlapScan",
+ return Utils.toSqlStringSkipNull("LogicalOlapScan[" + id.asInt() + "]",
"qualified", qualifiedName(),
"alias", tableAlias,
"indexName", getSelectedMaterializedIndexName().orElse("<index_not_selected>"),
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java
index fef5e46f2c0..35bce61733a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java
@@ -63,6 +63,8 @@ public class LogicalProject<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_
private final Supplier<Set<NamedExpression>> projectsSet;
private final boolean isDistinct;
+ private final HashMap projectMap;
+
public LogicalProject(List<NamedExpression> projects, CHILD_TYPE child) {
this(projects, false, ImmutableList.of(child));
}
@@ -90,6 +92,17 @@ public class LogicalProject<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_
: projects;
this.projectsSet = Suppliers.memoize(() -> Utils.fastToImmutableSet(this.projects));
this.isDistinct = isDistinct;
+ this.projectMap = new HashMap<>();
+ for (NamedExpression namedExpression : projects) {
+ if (namedExpression.hasUnbound()) {
+ projectMap.clear();
+ break;
+ }
+ if (namedExpression instanceof Alias) {
+ Alias alias = (Alias) namedExpression;
+ projectMap.put(alias.toSlot(), alias.child());
+ }
+ }
}
/**
@@ -315,13 +328,6 @@ public class LogicalProject<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_
*
*/
public Expression pushDownExpressionPastProject(Expression expression) {
- HashMap projectMap = new HashMap();
- for (NamedExpression namedExpression : projects) {
- if (namedExpression instanceof Alias) {
- Alias alias = (Alias) namedExpression;
- projectMap.put(alias.toSlot(), alias.child());
- }
- }
return ExpressionUtils.replace(expression, projectMap);
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
index 25ff7d55720..913f89d5c61 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
@@ -40,6 +40,7 @@ import org.apache.doris.nereids.types.DecimalV3Type;
import org.apache.doris.nereids.types.MapType;
import org.apache.doris.nereids.types.StructField;
import org.apache.doris.nereids.types.StructType;
+import org.apache.doris.nereids.util.ExpressionUtils;
import org.apache.doris.nereids.util.TypeCoercionUtils;
import org.apache.doris.qe.GlobalVariable;
import org.apache.doris.qe.SessionVariable;
@@ -76,14 +77,18 @@ public abstract class LogicalSetOperation extends AbstractLogicalPlan
this.regularChildrenOutputs = ImmutableList.of();
}
+ /**
+ * constructor
+ */
public LogicalSetOperation(PlanType planType, Qualifier qualifier,
List<NamedExpression> outputs, List<List<SlotReference>> regularChildrenOutputs, List<Plan> children) {
- super(planType, children);
- this.qualifier = qualifier;
- this.outputs = ImmutableList.copyOf(outputs);
- this.regularChildrenOutputs = ImmutableList.copyOf(regularChildrenOutputs);
+ this(planType, qualifier, outputs, regularChildrenOutputs, Optional.empty(),
+ Optional.empty(), children);
}
+ /**
+ * constr
+ */
public LogicalSetOperation(PlanType planType, Qualifier qualifier, List<NamedExpression> outputs,
List<List<SlotReference>> regularChildrenOutputs,
Optional<GroupExpression> groupExpression, Optional<LogicalProperties> logicalProperties,
@@ -92,6 +97,38 @@ public abstract class LogicalSetOperation extends AbstractLogicalPlan
this.qualifier = qualifier;
this.outputs = ImmutableList.copyOf(outputs);
this.regularChildrenOutputs = ImmutableList.copyOf(regularChildrenOutputs);
+ //if (SessionVariable.isFeDebug()) {
+ // checkOutputs(outputs, regularChildrenOutputs)
+ // .ifPresent(msg -> SessionVariable.throwAnalysisExceptionWhenFeDebug(msg));
+ //}
+ }
+
+ // check every slot in outputs has its counterpart in regularChildrenOutputs, and they have the same data type.
+ private Optional<String> checkOutputs(List<NamedExpression> outputs,
+ List<List<SlotReference>> regularChildrenOutputs) {
+ if (!regularChildrenOutputs.isEmpty() && !outputs.isEmpty()) {
+ for (List<SlotReference> childOutput : regularChildrenOutputs) {
+ if (outputs.size() != childOutput.size()) {
+ return Optional.of("regularChildrenOutputs size error: regularOutput "
+ + childOutput + " output: " + outputs);
+ }
+ for (int i = 0; i < childOutput.size(); i++) {
+ DataType outputDataType = outputs.get(i).getDataType();
+ boolean outputNullable = outputs.get(i).nullable();
+ String outputInfo = outputNullable ? "+" : "-" + outputDataType;
+ DataType childDataType = childOutput.get(i).getDataType();
+ boolean childNullable = childOutput.get(i).nullable();
+ String childInfo = childNullable ? "+" : "-" + childDataType;
+ if (!outputDataType.equals(childDataType)
+ || outputNullable != childNullable) {
+ return Optional.of("regularChildrenOutputs data type is different from output. "
+ + "regularOutput slot: " + childOutput.get(i)
+ + "[" + childInfo + "], output: " + outputs.get(i) + "[" + outputInfo + "]");
+ }
+ }
+ }
+ }
+ return Optional.empty();
}
public List<List<SlotReference>> getRegularChildrenOutputs() {
@@ -312,4 +349,45 @@ public abstract class LogicalSetOperation extends AbstractLogicalPlan
public Optional<Plan> processProject(List<NamedExpression> parentProjects) {
return Optional.of(PushProjectThroughUnion.doPushProject(parentProjects, this));
}
+
+ /**
+ * Push down expression past SetOperation to a specific child.
+ *
+ * This method maps the expression from the SetOperation's output slots
+ * to the corresponding child's output slots.
+ *
+ * Example:
+ * SetOperation outputs: [x, y]
+ * Child 0 outputs (regularChildrenOutputs[0]): [a, b]
+ * Child 1 outputs (regularChildrenOutputs[1]): [c, d]
+ *
+ * If expression is "x + 1":
+ * - For childIdx=0, return "a + 1"
+ * - For childIdx=1, return "c + 1"
+ *
+ * @param expression the expression to push down
+ * @param childIdx the index of the child to push down to
+ * @return the rewritten expression for the child, or null if childIdx is out of
+ * bounds
+ */
+ public Expression pushDownExpressionPastSetOperator(Expression expression, int childIdx) {
+ // Check if childIdx is valid
+ if (childIdx < 0 || childIdx >= regularChildrenOutputs.size()) {
+ return null;
+ }
+
+ // Build mapping from SetOperation output slots to child output slots
+ java.util.HashMap<Slot, Expression> slotMapping = new java.util.HashMap<>();
+ List<SlotReference> childOutputs = regularChildrenOutputs.get(childIdx);
+
+ // Map each output slot to the corresponding child slot
+ for (int i = 0; i < outputs.size() && i < childOutputs.size(); i++) {
+ Slot outputSlot = outputs.get(i).toSlot();
+ SlotReference childSlot = childOutputs.get(i);
+ slotMapping.put(outputSlot, childSlot);
+ }
+
+ // Replace slots in the expression using the mapping
+ return ExpressionUtils.replace(expression, slotMapping);
+ }
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalUnion.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalUnion.java
index 1a1b3b2e84e..55ffc5a286a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalUnion.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalUnion.java
@@ -114,7 +114,7 @@ public class LogicalUnion extends LogicalSetOperation implements Union, OutputPr
@Override
public String toString() {
- return Utils.toSqlStringSkipNull("LogicalUnion",
+ return Utils.toSqlStringSkipNull("LogicalUnion[" + id.asInt() + "]",
"qualifier", qualifier,
"outputs", outputs,
"regularChildrenOutputs", regularChildrenOutputs,
@@ -424,4 +424,12 @@ public class LogicalUnion extends LogicalSetOperation implements Union, OutputPr
}
return changed ? castedRow.build() : row;
}
+
+ public LogicalSetOperation withChildrenAndOutputs(List<Plan> children, List<NamedExpression> newOuptuts,
+ List<List<SlotReference>> childrenOutputs) {
+ Preconditions.checkArgument(children.size() == childrenOutputs.size(),
+ "children size %s is not equals with children outputs size %s",
+ children.size(), childrenOutputs.size());
+ return new LogicalUnion(qualifier, newOuptuts, childrenOutputs, constantExprsList, hasPushedFilter, children);
+ }
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
index f131128a088..b8987334668 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
@@ -54,6 +54,7 @@ import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.SlotReference;
import org.apache.doris.nereids.trees.expressions.WhenClause;
import org.apache.doris.nereids.trees.expressions.WindowExpression;
+import org.apache.doris.nereids.trees.expressions.functions.BoundFunction;
import org.apache.doris.nereids.trees.expressions.functions.agg.Avg;
import org.apache.doris.nereids.trees.expressions.functions.agg.Max;
import org.apache.doris.nereids.trees.expressions.functions.agg.Min;
@@ -211,14 +212,57 @@ public class ExpressionUtils {
}
/**
- * AND / OR expression, also remove duplicate expression, boolean literal
+ * Rebuild expression tree and refresh BoundFunction signatures.
+ * If an expression is a BoundFunction, recreate it with rebuilt children and
+ * reset its signature.
+ * Other expressions are recreated only when children change.
+ *
+ * @return rebuilt expression (may be the same instance when unchanged and
+ * non-BoundFunction)
+ */
+ public static Expression rebuildSignature(Expression expr) {
+ List<Expression> newChildren = expr.children().stream()
+ .map(ExpressionUtils::rebuildSignature)
+ .collect(Collectors.toList());
+ return MoreFieldsThread.keepFunctionSignature(false,
+ () -> {
+ boolean childrenUnchanged = true;
+ List<Expression> originChildren = expr.children();
+ if (originChildren.size() != newChildren.size()) {
+ childrenUnchanged = false;
+ } else {
+ for (int i = 0; i < originChildren.size(); i++) {
+ if (originChildren.get(i) != newChildren.get(i)) {
+ childrenUnchanged = false;
+ break;
+ }
+ }
+ }
+
+ if (expr instanceof BoundFunction) {
+ BoundFunction fn = (BoundFunction) expr;
+ BoundFunction rebuilt = (BoundFunction) fn.withChildren(newChildren);
+ rebuilt = (BoundFunction) TypeCoercionUtils.processBoundFunction(rebuilt);
+ return rebuilt;
+ }
+
+ if (childrenUnchanged) {
+ return expr;
+ }
+ return expr.withChildren(newChildren);
+ });
+
+ }
+
+ /**
+ * AND / OR expression, also remove duplicate expression, boolean literal
*/
public static Expression compound(boolean isAnd, Collection<Expression> expressions) {
return isAnd ? and(expressions) : or(expressions);
}
/**
- * AND expression, also remove duplicate expression, boolean literal
+ * AND expression, also remove duplicate expression, boolean literal
*/
public static Expression and(Collection<Expression> expressions) {
if (expressions.size() == 1) {
@@ -244,7 +288,7 @@ public class ExpressionUtils {
}
/**
- * AND expression, also remove duplicate expression, boolean literal
+ * AND expression, also remove duplicate expression, boolean literal
*/
public static Expression and(Expression... expressions) {
return and(Lists.newArrayList(expressions));
@@ -259,14 +303,14 @@ public class ExpressionUtils {
}
/**
- * OR expression, also remove duplicate expression, boolean literal
+ * OR expression, also remove duplicate expression, boolean literal
*/
public static Expression or(Expression... expressions) {
return or(Lists.newArrayList(expressions));
}
/**
- * OR expression, also remove duplicate expression, boolean literal
+ * OR expression, also remove duplicate expression, boolean literal
*/
public static Expression or(Collection<Expression> expressions) {
if (expressions.size() == 1) {
@@ -676,10 +720,9 @@ public class ExpressionUtils {
* the mark slot can be non-nullable boolean
* and in semi join, we can safely change the mark conjunct to hash conjunct
*/
- ImmutableList<Literal> literals =
- ImmutableList.of(NullLiteral.BOOLEAN_INSTANCE, BooleanLiteral.FALSE);
- List<MarkJoinSlotReference> markJoinSlotReferenceList =
- new ArrayList<>((predicate.collect(MarkJoinSlotReference.class::isInstance)));
+ ImmutableList<Literal> literals = ImmutableList.of(NullLiteral.BOOLEAN_INSTANCE, BooleanLiteral.FALSE);
+ List<MarkJoinSlotReference> markJoinSlotReferenceList = new ArrayList<>(
+ (predicate.collect(MarkJoinSlotReference.class::isInstance)));
int markSlotSize = markJoinSlotReferenceList.size();
int maxMarkSlotCount = 4;
// if the conjunct has mark slot, and maximum 4 mark slots(for performance)
@@ -688,9 +731,9 @@ public class ExpressionUtils {
boolean meetTrue = false;
boolean meetNullOrFalse = false;
/*
- * markSlotSize = 1 -> loopCount = 2 ---- 0, 1
- * markSlotSize = 2 -> loopCount = 4 ---- 00, 01, 10, 11
- * markSlotSize = 3 -> loopCount = 8 ---- 000, 001, 010, 011, 100, 101, 110, 111
+ * markSlotSize = 1 -> loopCount = 2 ---- 0, 1
+ * markSlotSize = 2 -> loopCount = 4 ---- 00, 01, 10, 11
+ * markSlotSize = 3 -> loopCount = 8 ---- 000, 001, 010, 011, 100, 101, 110, 111
* markSlotSize = 4 -> loopCount = 16 ---- 0000, 0001, ... 1111
*/
int loopCount = 1 << markSlotSize;
@@ -706,8 +749,7 @@ public class ExpressionUtils {
}
Expression evalResult = FoldConstantRule.evaluate(
ExpressionUtils.replace(predicate, replaceMap),
- ctx
- );
+ ctx);
if (evalResult.equals(BooleanLiteral.TRUE)) {
if (meetNullOrFalse) {
@@ -746,8 +788,7 @@ public class ExpressionUtils {
replaceMap.put(slot, nullLiteral);
Expression evalExpr = FoldConstantRule.evaluate(
ExpressionUtils.replace(predicate, replaceMap),
- new ExpressionRewriteContext(cascadesContext)
- );
+ new ExpressionRewriteContext(cascadesContext));
if (evalExpr.isNullLiteral() || BooleanLiteral.FALSE.equals(evalExpr)) {
notNullSlots.add(slot);
}
@@ -923,7 +964,7 @@ public class ExpressionUtils {
return expression instanceof Slot;
}
- // if the input is unique, the output of agg is unique, too
+ // if the input is unique, the output of agg is unique, too
public static boolean isInjectiveAgg(Expression agg) {
return agg instanceof Sum || agg instanceof Avg || agg instanceof Max || agg instanceof Min;
}
@@ -941,7 +982,8 @@ public class ExpressionUtils {
public static <E> List<E> collectAll(Collection<? extends Expression> expressions,
Predicate<TreeNode<Expression>> predicate) {
switch (expressions.size()) {
- case 0: return ImmutableList.of();
+ case 0:
+ return ImmutableList.of();
default: {
ImmutableList.Builder<E> result = ImmutableList.builder();
for (Expression expr : expressions) {
@@ -1050,14 +1092,13 @@ public class ExpressionUtils {
*/
public static boolean checkSlotConstant(Slot slot, Set<Expression> predicates) {
return predicates.stream().anyMatch(predicate -> {
- if (predicate instanceof EqualTo) {
- EqualTo equalTo = (EqualTo) predicate;
- return (equalTo.left() instanceof Literal && equalTo.right().equals(slot))
- || (equalTo.right() instanceof Literal && equalTo.left().equals(slot));
- }
- return false;
- }
- );
+ if (predicate instanceof EqualTo) {
+ EqualTo equalTo = (EqualTo) predicate;
+ return (equalTo.left() instanceof Literal && equalTo.right().equals(slot))
+ || (equalTo.right() instanceof Literal && equalTo.left().equals(slot));
+ }
+ return false;
+ });
}
/**
@@ -1175,8 +1216,7 @@ public class ExpressionUtils {
}
ExpressionRewriteContext context = new ExpressionRewriteContext(cascadesContext);
ExpressionRuleExecutor executor = new ExpressionRuleExecutor(ImmutableList.of(
- ExpressionRewrite.bottomUp(ReplaceVariableByLiteral.INSTANCE)
- ));
+ ExpressionRewrite.bottomUp(ReplaceVariableByLiteral.INSTANCE)));
Expression rewrittenExpression = executor.rewrite(analyzedExpr, context);
Expression foldExpression = FoldConstantRule.evaluate(rewrittenExpression, context);
if (foldExpression instanceof Literal) {
@@ -1251,8 +1291,8 @@ public class ExpressionUtils {
public static Optional<List<Expression>> getCaseWhenLikeBranchResults(Expression expression) {
if (expression instanceof CaseWhen) {
CaseWhen caseWhen = (CaseWhen) expression;
- ImmutableList.Builder<Expression> builder
- = ImmutableList.builderWithExpectedSize(caseWhen.getWhenClauses().size() + 1);
+ ImmutableList.Builder<Expression> builder = ImmutableList
+ .builderWithExpectedSize(caseWhen.getWhenClauses().size() + 1);
for (WhenClause whenClause : caseWhen.getWhenClauses()) {
builder.add(whenClause.getResult());
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index f92d4566f34..2c277defeca 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -29,6 +29,7 @@ import org.apache.doris.common.io.Writable;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.common.util.Util;
import org.apache.doris.nereids.StatementContext;
+import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.glue.LogicalPlanAdapter;
import org.apache.doris.nereids.metrics.Event;
import org.apache.doris.nereids.metrics.EventSwitchParser;
@@ -2251,6 +2252,38 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = DPHYPER_LIMIT)
public int dphyperLimit = 1000;
+ @VariableMgr.VarAttr(name = "eager_aggregation_mode", needForward = true,
+ description = {"0: 根据统计信息决定是使用eager aggregation,"
+ + "1: 强制使用 eager aggregation,"
+ + "-1: 禁止使用 eager aggregation",
+ "0: Determine eager aggregation by statistics, "
+ + "1: force eager aggregation, "
+ + "-1: Prohibit eager aggregation "}
+ )
+ private int eagerAggregationMode = 0;
+
+ public static int getEagerAggregationMode() {
+ if (ConnectContext.get() != null) {
+ return ConnectContext.get().getSessionVariable().eagerAggregationMode;
+ } else {
+ return VariableMgr.getDefaultSessionVariable().eagerAggregationMode;
+ }
+ }
+
+ public void setEagerAggregationMode(int mode) {
+ this.eagerAggregationMode = mode;
+ }
+
+ @VariableMgr.VarAttr(name = "eager_aggregation_on_join", needForward = true)
+ public boolean eagerAggregationOnJoin = false;
+
+ public static boolean isEagerAggregationOnJoin() {
+ if (ConnectContext.get() != null) {
+ return ConnectContext.get().getSessionVariable().eagerAggregationOnJoin;
+ } else {
+ return VariableMgr.getDefaultSessionVariable().eagerAggregationOnJoin;
+ }
+ }
@VariableMgr.VarAttr(
name = ENABLE_PAGE_CACHE,
@@ -6200,6 +6233,13 @@ public class SessionVariable implements Serializable, Writable {
}
}
+ public static void throwAnalysisExceptionWhenFeDebug(String msg) {
+ LOG.warn(msg);
+ if (isFeDebug()) {
+ throw new AnalysisException(msg);
+ }
+ }
+
public Map<String, String> getAffectQueryResultInPlanVariables() {
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
try {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index 4284ddbfc4a..f2afbc47085 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -771,9 +771,7 @@ public class StmtExecutor {
new AnalysisException(e.getMessage(), e));
} catch (Exception | Error e) {
// Maybe our bug
- if (LOG.isDebugEnabled()) {
- LOG.debug("Command({}) process failed.", originStmt.originStmt, e);
- }
+ LOG.info("Command({}) process failed.", originStmt.originStmt, e);
context.getState().setError(ErrorCode.ERR_UNKNOWN_ERROR, e.getMessage());
throw new NereidsException("Command (" + originStmt.originStmt + ") process failed.",
new AnalysisException(e.getMessage() == null ? e.toString() : e.getMessage(), e));
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushDownExpressionsInHashConditionTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushDownExpressionsInHashConditionTest.java
index 7f860062b0e..0eaccde391f 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushDownExpressionsInHashConditionTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushDownExpressionsInHashConditionTest.java
@@ -235,7 +235,7 @@ public class PushDownExpressionsInHashConditionTest extends TestWithFeService im
PlanChecker.from(connectContext, plan).applyTopDown(new PushDownExpressionsInHashCondition())
.matches(logicalJoin(logicalProject(logicalOneRowRelation())
- .when(p -> p.getProjects().size() == 4
+ .when("left project", p -> p.getProjects().size() == 4
&& p.getProjects().stream().filter(Alias.class::isInstance)
.map(Alias.class::cast).map(UnaryNode::child)
.filter(sameLeft::equals).count() == 1
@@ -246,7 +246,7 @@ public class PushDownExpressionsInHashConditionTest extends TestWithFeService im
.map(Alias.class::cast).map(UnaryNode::child)
.filter(hashLeft::equals).count() == 1),
logicalProject(logicalOneRowRelation())
- .when(p -> p.getProjects().size() == 4
+ .when("right project", p -> p.getProjects().size() == 4
&& p.getProjects().stream().filter(Alias.class::isInstance)
.map(Alias.class::cast).map(UnaryNode::child)
.filter(sameRight::equals).count() == 1
@@ -256,12 +256,12 @@ public class PushDownExpressionsInHashConditionTest extends TestWithFeService im
&& p.getProjects().stream().filter(Alias.class::isInstance)
.map(Alias.class::cast).map(UnaryNode::child)
.filter(hashRight::equals).count() == 1)
- ).when(j -> j.getMarkJoinConjuncts().size() == 3
+ ).when("join mark condition", j -> j.getMarkJoinConjuncts().size() == 3
&& j.getMarkJoinConjuncts().stream().filter(EqualTo.class::isInstance)
.allMatch(e -> ((EqualTo) e).left() instanceof SlotReference
&& ((EqualTo) e).right() instanceof SlotReference)
&& j.getMarkJoinConjuncts().stream().filter(EqualTo.class::isInstance).count() == 2)
- .when(j -> j.getHashJoinConjuncts().size() == 2
+ .when("join hash condition", j -> j.getHashJoinConjuncts().size() == 2
&& j.getHashJoinConjuncts().stream().filter(EqualTo.class::isInstance)
.allMatch(e -> ((EqualTo) e).left() instanceof SlotReference
&& ((EqualTo) e).right() instanceof SlotReference)
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/EagerAggRewriterTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/EagerAggRewriterTest.java
new file mode 100644
index 00000000000..0af3144ab69
--- /dev/null
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/EagerAggRewriterTest.java
@@ -0,0 +1,285 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.rewrite.eageraggregation;
+
+import org.apache.doris.nereids.util.MemoPatternMatchSupported;
+import org.apache.doris.nereids.util.PlanChecker;
+import org.apache.doris.utframe.TestWithFeService;
+
+import org.junit.jupiter.api.Test;
+
+class EagerAggRewriterTest extends TestWithFeService implements MemoPatternMatchSupported {
+ @Override
+ protected void runBeforeAll() throws Exception {
+ createDatabase("test");
+ connectContext.setDatabase("default_cluster:test");
+ createTables(
+ "CREATE TABLE IF NOT EXISTS t1 (\n"
+ + " id1 int not null,\n"
+ + " name varchar(20)\n"
+ + ")\n"
+ + "DUPLICATE KEY(id1)\n"
+ + "DISTRIBUTED BY HASH(id1) BUCKETS 10\n"
+ + "PROPERTIES (\"replication_num\" = \"1\")\n",
+ "CREATE TABLE IF NOT EXISTS t2 (\n"
+ + " id2 int not null,\n"
+ + " name varchar(20)\n"
+ + ")\n"
+ + "DUPLICATE KEY(id2)\n"
+ + "DISTRIBUTED BY HASH(id2) BUCKETS 10\n"
+ + "PROPERTIES (\"replication_num\" = \"1\")\n"
+ );
+ connectContext.getSessionVariable().setDisableNereidsRules("PRUNE_EMPTY_PARTITION");
+ }
+
+ @Test
+ void testNotPushAggCaseWhenToNullableSideOfOuterJoin() {
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ // RIGHT JOIN: agg function (case-when) references left side columns,
+ // left side is nullable, should NOT be pushed below the join
+ String sql = "select max(case when t1.name is not null then 'aaa' end) from t1 right join t2 on t1.id1 = t2.id2"
+ + " group by t1.id1";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(logicalAggregate(), any()))
+ .printlnTree();
+
+ // LEFT JOIN: agg function(case-when) references right side columns,
+ // right side is nullable, should NOT be pushed below the join
+ sql = "select max(case when t2.name is null then 'xxx' end) from t1 left join t2"
+ + " on t1.id1 = t2.id2 group by t1.id1";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(any(), logicalAggregate()))
+ .printlnTree();
+ // RIGHT JOIN: agg function (not-case-when) references left side columns,
+ // left side is nullable, can be pushed below the join
+ sql = "select max(t2.name) from t1 left join t2"
+ + " on t1.id1 = t2.id2 group by t1.id1";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .matches(logicalJoin(any(), logicalAggregate()))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ }
+ }
+
+ @Test
+ void testPushDownCount() {
+ // Test count pushdown: count(a) should be pushed down and
+ // the top aggregation should use sum to aggregate the count results
+ // Before: agg(count(name), groupby(id2))
+ // -> join(t1.id1=t2.id2)
+ // -> t1(id1, name)
+ // -> t2(id2)
+ // After: agg(sum(x), groupby(id2))
+ // -> join(t1.id1=t2.id2)
+ // -> agg(count(name) as x, groupby(id1))
+ // -> t1(id1, name)
+ // -> t2(id2)
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ try {
+ String sql = "select count(t1.name), t2.id2 from t1 join t2 on t1.id1 = t2.id2 group by t2.id2";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .matches(logicalAggregate(logicalProject(logicalJoin(logicalAggregate(), any()))))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ }
+ }
+
+ @Test
+ void testNotPushDownDistinctAgg() {
+ // Distinct aggregation should not be pushed down.
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ String sql = "select count(distinct t1.name), t2.id2 from t1 join t2"
+ + " on t1.id1 = t2.id2 group by t2.id2";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(logicalAggregate(), any()))
+ .nonMatch(logicalJoin(any(), logicalAggregate()))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ connectContext.getSessionVariable().setDisableJoinReorder(false);
+ }
+ }
+
+ @Test
+ void testPushDownCountThroughLeftJoinWrapsWithIfnull() {
+ // When count(right.col) is pushed down to the right side of a LEFT JOIN,
+ // the top aggregate rolls up count to sum. But when the LEFT JOIN has no
+ // matching right row, the intermediate count slot becomes NULL (null-extended),
+ // and sum(NULL) = NULL. The correct result should be 0 (COUNT never returns NULL).
+ // Fix: wrap the rolled-up sum with ifnull(sum(x), 0).
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ String sql = "select count(t2.id2), t1.id1 from t1 left join t2"
+ + " on t1.name = t2.name group by t1.id1";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .matches(logicalProject(logicalAggregate(logicalProject(logicalJoin(any(),
+ logicalAggregate()))))
+ .when(project -> project.getProjects().stream().anyMatch(
+ expr -> expr.toString().contains("ifnull")
+ )))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ connectContext.getSessionVariable().setDisableJoinReorder(false);
+ }
+ }
+
+ @Test
+ void testNotPushCountStarToNullableSideOfOuterJoin() {
+ // count(*)/count(1) counts all physical rows including null-extended rows.
+ // Pushing it to the nullable side loses the count of unmatched rows:
+ // original: count(*) on unmatched row = 1
+ // pushed: ifnull(sum(NULL), 0) = 0 (wrong!)
+ // So count(*)/count(1) must NOT be pushed to the nullable side.
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ // LEFT JOIN: right side (t1) is nullable, count(*) should NOT push to right
+ String sql = "select count(1), t2.id2 from t2 left join t1"
+ + " on t2.name = t1.name group by t2.id2";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(any(), logicalAggregate()))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ connectContext.getSessionVariable().setDisableJoinReorder(false);
+ }
+ }
+
+ @Test
+ void testPushDownCountWithIfChildShouldNotDecompose() {
+ // Count(If(cond, a, b)) should NOT be decomposed into Count(a) and Count(b)
+ // in the SumIf path, because the replacement logic cannot match decomposed
+ // Count(a)/Count(b) as sub-expressions of the original Count(If(cond, a, b)).
+ // This would cause "Input slot(s) not in child's output" error.
+ // Instead, Count(If(...)) should be pushed down as-is and rolled up via
+ // ifnull(sum(count_if_result), 0).
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ String sql = "select count(case when t1.id1 > 3 then t1.name else 'x' end), t2.id2"
+ + " from t1 left join t2 on t1.name = t2.name group by t2.id2";
+ // Should not throw "Input slot(s) not in child's output"
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ connectContext.getSessionVariable().setDisableJoinReorder(false);
+ }
+ }
+
+ @Test
+ void testNotPushCountIfIsNullToNullableSideOfOuterJoin() {
+ // count(if(col IS NULL, value, NULL)) must NOT be pushed to the nullable side
+ // of an outer join. The If expression (normalized from CASE WHEN) with an IS NULL
+ // condition produces wrong results when pushed:
+ // - Original: for null-extended rows, col IS NULL = TRUE, count returns 1
+ // - Pushed: pre-agg count slot becomes NULL after null-extension,
+ // ifnull(sum(NULL), 0) = 0 (wrong!)
+ // This test ensures If expressions get the same protection as CaseWhen.
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ // RIGHT JOIN: t1 is the nullable side (left side of RIGHT JOIN)
+ // count(case when t1.name IS NULL then 'x' end) should NOT be pushed to t1
+ String sql = "select count(case when t1.name is null then 'x' end), t2.id2"
+ + " from t1 right join t2 on t1.id1 = t2.id2 group by t2.id2";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(logicalAggregate(), any()))
+ .printlnTree();
+
+ // LEFT JOIN: t2 is the nullable side (right side of LEFT JOIN)
+ // count(case when t2.name IS NULL then 'y' end) should NOT be pushed to t2
+ sql = "select count(case when t2.name is null then 'y' end), t1.id1"
+ + " from t1 left join t2 on t1.id1 = t2.id2 group by t1.id1";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(any(), logicalAggregate()))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ connectContext.getSessionVariable().setDisableJoinReorder(false);
+ }
+ }
+
+ @Test
+ void testNotPushCountCaseWhenWithElseToNullableSideViaProject() {
+ // When CASE WHEN has an ELSE clause (e.g. CASE WHEN cond THEN -121 ELSE 2 END),
+ // NormalizeAggregate extracts if(cond, -121, 2) into a Project as a slot,
+ // so the aggregate becomes count(#slot). At the agg level, hasCaseWhen=false
+ // because count(#slot) contains no If/CaseWhen.
+ //
+ // EagerAggRewriter must recheck hasCaseWhen after substituting through the
+ // Project (in createContextFromProject), otherwise count(if(cond, -121, 2))
+ // is incorrectly pushed to the nullable side of an outer join.
+ //
+ // On null-extended rows: if(NULL_cond, -121, 2) = 2 (ELSE branch), count(2) = 1.
+ // But pre-agg doesn't include null-extended rows → ifnull(sum(NULL), 0) = 0 (wrong!).
+ connectContext.getSessionVariable().setEagerAggregationMode(1);
+ connectContext.getSessionVariable().setDisableJoinReorder(true);
+ try {
+ // RIGHT JOIN: t1 is the nullable side
+ // count(case when t1.id1 > 5 then -121 else 2 end) must NOT be pushed to t1
+ String sql = "select count(case when t1.id1 > 5 then -121 else 2 end), t2.id2"
+ + " from t1 right join t2 on t1.id1 = t2.id2 group by t2.id2";
+ PlanChecker.from(connectContext)
+ .analyze(sql)
+ .rewrite()
+ .nonMatch(logicalJoin(logicalAggregate(), any()))
+ .printlnTree();
+
+ // LEFT JOIN: t2 is the nullable side
+ String sql2 = "select count(case when t2.id2 > 5 then -121 else 2 end), t1.id1"
+ + " from t1 left join t2 on t1.id1 = t2.id2 group by t1.id1";
+ PlanChecker.from(connectContext)
+ .analyze(sql2)
+ .rewrite()
+ .nonMatch(logicalJoin(any(), logicalAggregate()))
+ .printlnTree();
+ } finally {
+ connectContext.getSessionVariable().setEagerAggregationMode(0);
+ connectContext.getSessionVariable().setDisableJoinReorder(false);
+ }
+ }
+}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/PlanToStringTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/PlanToStringTest.java
index c8b311ee219..0f94e2d8cec 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/PlanToStringTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/PlanToStringTest.java
@@ -115,8 +115,9 @@ public class PlanToStringTest {
@Test
public void testLogicalOlapScan() {
LogicalOlapScan plan = PlanConstructor.newLogicalOlapScan(0, "table", 0);
+ System.out.println(plan.toString());
Assertions.assertTrue(
- plan.toString().matches("LogicalOlapScan \\( qualified=db\\.table, "
+ plan.toString().matches("LogicalOlapScan\\[\\d\\] \\( qualified=db\\.table, "
+ "indexName=<index_not_selected>, "
+ "selectedIndexId=-1, preAgg=UNSET, operativeCol=\\[].*"));
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/MatchingUtils.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/MatchingUtils.java
index b1beb5a52f6..c6f3c338ea9 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/MatchingUtils.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/MatchingUtils.java
@@ -31,6 +31,9 @@ import org.apache.doris.nereids.trees.plans.physical.PhysicalPlan;
import com.google.common.base.Supplier;
import org.junit.jupiter.api.Assertions;
+import java.util.ArrayList;
+import java.util.List;
+
public class MatchingUtils {
public static void assertMatches(Plan plan, PatternDescriptor<? extends Plan> patternDesc) {
@@ -90,4 +93,55 @@ public class MatchingUtils {
}
return false;
}
+
+ /**
+ * Diagnostic version: find the best partial match in the memo and return
+ * a description of where/why the match failed. Returns null if match succeeds.
+ */
+ public static String topDownFindMatchingDiagnostic(Group group, Pattern<? extends Plan> pattern) {
+ // First try to match from root - this is the most common case in tests.
+ // We run the diagnostic on the copied-out plan from each root group expression.
+ String bestDiagnostic = null;
+
+ for (GroupExpression logicalExpr : group.getLogicalExpressions()) {
+ Plan copiedPlan = copyOutFromGroupExpression(logicalExpr);
+ String diagnostic = ((Pattern<Plan>) pattern).matchPlanTreeDiagnostic(copiedPlan, "root");
+ if (diagnostic == null) {
+ return null; // match found
+ }
+ if (bestDiagnostic == null) {
+ bestDiagnostic = diagnostic;
+ }
+ }
+
+ for (GroupExpression physicalExpr : group.getPhysicalExpressions()) {
+ Plan copiedPlan = copyOutFromGroupExpression(physicalExpr);
+ String diagnostic = ((Pattern<Plan>) pattern).matchPlanTreeDiagnostic(copiedPlan, "root");
+ if (diagnostic == null) {
+ return null;
+ }
+ if (bestDiagnostic == null) {
+ bestDiagnostic = diagnostic;
+ }
+ }
+
+ return bestDiagnostic != null ? bestDiagnostic : "no group expressions found in root group";
+ }
+
+ private static Plan copyOutFromGroupExpression(GroupExpression groupExpression) {
+ Plan plan = groupExpression.getPlan();
+ List<Plan> children = new ArrayList<>();
+ for (Group childGroup : groupExpression.children()) {
+ // pick first logical expression, fallback to first physical
+ if (!childGroup.getLogicalExpressions().isEmpty()) {
+ children.add(copyOutFromGroupExpression(childGroup.getLogicalExpressions().get(0)));
+ } else if (!childGroup.getPhysicalExpressions().isEmpty()) {
+ children.add(copyOutFromGroupExpression(childGroup.getPhysicalExpressions().get(0)));
+ }
+ }
+ if (!children.isEmpty()) {
+ return plan.withChildren(children);
+ }
+ return plan;
+ }
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java
index be5a92ef08b..433ad2f0177 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java
@@ -43,6 +43,7 @@ import org.apache.doris.nereids.memo.Memo;
import org.apache.doris.nereids.parser.NereidsParser;
import org.apache.doris.nereids.pattern.GroupExpressionMatching;
import org.apache.doris.nereids.pattern.MatchingContext;
+import org.apache.doris.nereids.pattern.Pattern;
import org.apache.doris.nereids.pattern.PatternDescriptor;
import org.apache.doris.nereids.pattern.PatternMatcher;
import org.apache.doris.nereids.processor.post.Validator;
@@ -616,8 +617,9 @@ public class PlanChecker {
public PlanChecker matchesFromRoot(PatternDescriptor<? extends Plan> patternDesc) {
Memo memo = cascadesContext.getMemo();
- assertMatches(memo, () -> new GroupExpressionMatching(patternDesc.pattern,
- memo.getRoot().getLogicalExpression()).iterator().hasNext());
+ assertMatchesWithDiagnostic(memo, patternDesc.pattern,
+ () -> new GroupExpressionMatching(patternDesc.pattern,
+ memo.getRoot().getLogicalExpression()).iterator().hasNext());
return this;
}
@@ -631,7 +633,8 @@ public class PlanChecker {
public PlanChecker matches(PatternDescriptor<? extends Plan> patternDesc) {
Memo memo = cascadesContext.getMemo();
checkSlotFromChildren(memo);
- assertMatches(memo, () -> MatchingUtils.topDownFindMatching(memo.getRoot(), patternDesc.pattern));
+ assertMatchesWithDiagnostic(memo, patternDesc.pattern,
+ () -> MatchingUtils.topDownFindMatching(memo.getRoot(), patternDesc.pattern));
return this;
}
@@ -641,7 +644,7 @@ public class PlanChecker {
Memo memo = cascadesContext.getMemo();
checkSlotFromChildren(memo);
matchResult.add(MatchingUtils.topDownFindMatching(memo.getRoot(), patternDesc.pattern));
- assertMatches(memo, () -> matchResult.contains(true));
+ assertMatchesWithDiagnostic(memo, patternDesc.pattern, () -> matchResult.contains(true));
return this;
}
@@ -655,7 +658,8 @@ public class PlanChecker {
// TODO: remove it.
public PlanChecker matchesNotCheck(PatternDescriptor<? extends Plan> patternDesc) {
Memo memo = cascadesContext.getMemo();
- assertMatches(memo, () -> MatchingUtils.topDownFindMatching(memo.getRoot(), patternDesc.pattern));
+ assertMatchesWithDiagnostic(memo, patternDesc.pattern,
+ () -> MatchingUtils.topDownFindMatching(memo.getRoot(), patternDesc.pattern));
return this;
}
@@ -685,6 +689,16 @@ public class PlanChecker {
return this;
}
+ private PlanChecker assertMatchesWithDiagnostic(Memo memo,
+ Pattern<? extends Plan> pattern, Supplier<Boolean> asserter) {
+ if (!asserter.get()) {
+ String diagnostic = MatchingUtils.topDownFindMatchingDiagnostic(memo.getRoot(), pattern);
+ Assertions.fail("pattern not match.\nDiagnosis: " + diagnostic
+ + "\nActual plan:\n" + memo.copyOut().treeString() + "\n");
+ }
+ return this;
+ }
+
public PlanChecker checkGroupNum(int expectGroupNum) {
Assertions.assertEquals(expectGroupNum, cascadesContext.getMemo().getGroups().size());
return this;
diff --git a/regression-test/data/nereids_p0/eager_agg/eager_agg.out b/regression-test/data/nereids_p0/eager_agg/eager_agg.out
new file mode 100644
index 00000000000..2d5020b1c83
--- /dev/null
+++ b/regression-test/data/nereids_p0/eager_agg/eager_agg.out
@@ -0,0 +1,313 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !a --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashAgg[GLOBAL]
+----------hashAgg[LOCAL]
+------------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------------PhysicalOlapScan[store_sales(ss)]
+--------------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !a_exe --
+2024 66.00 54.00
+2025 50.00 42.00
+
+-- !a2 --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashAgg[GLOBAL]
+----------hashAgg[LOCAL]
+------------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------------PhysicalOlapScan[store_sales(ss)]
+--------------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !a2_exe --
+2024 120.00
+2025 92.00
+
+-- !sum_min_max --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashAgg[GLOBAL]
+----------hashAgg[LOCAL]
+------------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------------PhysicalOlapScan[store_sales(ss)]
+--------------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !sum_min_max_exe --
+2024 66.00 11.00 16.00
+2025 50.00 20.00 22.00
+
+-- !avg --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+----------PhysicalOlapScan[store_sales(ss)]
+----------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !avg_exe --
+2024 16.5000
+2025 25.0000
+
+-- !count_column --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+----------PhysicalOlapScan[store_sales(ss)]
+----------hashAgg[GLOBAL]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !count_column_exe --
+2024 4
+2025 2
+
+-- !count_star --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+----------hashAgg[GLOBAL]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[store_sales(ss)]
+----------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !count_star_exe --
+2024 4
+2025 2
+
+-- !count_sum_mixed --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashAgg[GLOBAL]
+----------hashAgg[LOCAL]
+------------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------------PhysicalOlapScan[store_sales(ss)]
+--------------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !count_sum_mixed_exe --
+2024 4 54.00
+2025 2 42.00
+
+-- !count_star_sum_mixed --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+----------hashAgg[GLOBAL]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[store_sales(ss)]
+----------PhysicalOlapScan[web_sales(ws)]
+--------PhysicalOlapScan[date_dim(dt)]
+
+Hint log:
+Used: leading({ ss broadcast ws } broadcast dt )
+UnUsed:
+SyntaxError:
+
+-- !count_star_sum_mixed_exe --
+2024 4 54.00
+2025 2 42.00
+
+-- !groupkey_push_SS_JOIN_D --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------hashAgg[GLOBAL]
+----------hashAgg[LOCAL]
+------------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+--------------PhysicalOlapScan[store_sales(ss)]
+--------------PhysicalOlapScan[date_dim(dt)]
+--------PhysicalOlapScan[web_sales(ws)]
+
+Hint log:
+Used: leading({ ss broadcast dt } broadcast ws )
+UnUsed:
+SyntaxError:
+
+-- !groupkey_push_SS_JOIN_D_exe --
+2024 10.00 12.00
+2024 15.00 17.00
+2024 25.00 29.00
+2025 18.00 21.00
+2025 20.00 23.00
+
+-- !groupkey_push --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+----------hashAgg[GLOBAL]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[store_sales(ss)]
+----------PhysicalOlapScan[date_dim(dt)]
+--------PhysicalOlapScan[web_sales(ws)]
+
+Hint log:
+Used: leading({ ss broadcast dt } broadcast ws )
+UnUsed:
+SyntaxError:
+
+-- !groupkey_push_exe --
+2024 20.00 22.00
+2024 30.00 32.00
+2025 18.00 20.00
+2025 20.00 22.00
+
+-- !sum_if_push --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = web_sales.ws_sold_date_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=()
+----------hashAgg[GLOBAL]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[web_sales]
+----------PhysicalOlapScan[item]
+--------PhysicalOlapScan[date_dim]
+
+Hint log:
+Used: leading({ web_sales broadcast item } broadcast date_dim )
+UnUsed:
+SyntaxError:
+
+-- !sum_if_push_exe --
+1 30.50 \N \N \N \N \N
+2 \N 22.00 \N \N \N \N
+
+-- !check_case_when_outer_join_not_push --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
+--------PhysicalOlapScan[store_sales]
+--------PhysicalOlapScan[date_dim]
+
+-- !check_no_case_when_outer_join_push --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
+--------hashAgg[GLOBAL]
+----------hashAgg[LOCAL]
+------------PhysicalOlapScan[store_sales]
+--------PhysicalOlapScan[date_dim]
+
+-- !check_no_push_value_slots_contains_if_slots --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
+--------PhysicalOlapScan[store_sales]
+--------PhysicalOlapScan[date_dim]
+
+-- !min_sum_same_slot --
+PhysicalResultSink
+--filter(brand IS NULL)
+----hashAgg[GLOBAL]
+------hashAgg[LOCAL]
+--------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+------------PhysicalOlapScan[store_sales(ss)]
+------------hashAgg[GLOBAL]
+--------------hashAgg[LOCAL]
+----------------PhysicalOlapScan[date_dim(dt)]
+----------PhysicalOlapScan[web_sales(ws)]
+
+Hint log:
+Used: leading({ ss broadcast dt } broadcast ws )
+UnUsed:
+SyntaxError:
+
+-- !min_sum_same_slot_exe --
+
+-- !sum_min_same_slot_exe --
+
+-- !no_push_aggkey_groupKey_overlap --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------hashJoin[INNER_JOIN] hashCondition=((ss.ss_item_sk = ws.ws_item_sk)) otherCondition=()
+--------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+----------PhysicalOlapScan[store_sales(ss)]
+----------PhysicalOlapScan[date_dim(dt)]
+--------PhysicalOlapScan[web_sales(ws)]
+
+Hint log:
+Used: leading({ ss broadcast dt } broadcast ws )
+UnUsed:
+SyntaxError:
+
+-- !no_push_not_all_union_children_push --
+PhysicalResultSink
+--hashAgg[GLOBAL]
+----hashAgg[LOCAL]
+------PhysicalUnion
+--------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = ss.ss_sold_date_sk)) otherCondition=()
+----------PhysicalOlapScan[store_sales(ss)]
+----------PhysicalOlapScan[date_dim(dt)]
+--------PhysicalOlapScan[date_dim]
+
+Hint log:
+Used:
+UnUsed:
+SyntaxError: leading({ ss broadcast dt } broadcast ws) Msg:can not find table: ws
+
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out b/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out
deleted file mode 100644
index 717af2c6806..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/basic.out
+++ /dev/null
@@ -1,98 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !1 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------filter((a.event_id = 'ad_click'))
-----------PhysicalOlapScan[com_dd_library(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 37.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
--- !2 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[com_dd_library(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
--- !3 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[com_dd_library(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
--- !4 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[com_dd_library(a)]
---------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
--- !with_hint_1 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------filter((a.event_id = 'ad_click'))
-------------PhysicalOlapScan[com_dd_library(a)]
---------hashAgg[GLOBAL]
-----------filter((cast(experiment_id as DECIMALV3(38, 6)) = 37.000000))
-------------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_2 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[com_dd_library(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_3 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[com_dd_library(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_4 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[com_dd_library(a)]
---------PhysicalOlapScan[shunt_log_com_dd_library(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out
deleted file mode 100644
index 40e57c30dd9..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/basic_one_side.out
+++ /dev/null
@@ -1,98 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !1 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------filter((a.event_id = 'ad_click'))
-----------PhysicalOlapScan[com_dd_library_one_side(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 37.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
--- !2 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[com_dd_library_one_side(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
--- !3 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[com_dd_library_one_side(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
--- !4 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------PhysicalOlapScan[com_dd_library_one_side(a)]
---------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
--- !with_hint_1 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------filter((a.event_id = 'ad_click'))
-------------PhysicalOlapScan[com_dd_library_one_side(a)]
---------hashAgg[GLOBAL]
-----------filter((cast(experiment_id as DECIMALV3(38, 6)) = 37.000000))
-------------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_2 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[com_dd_library_one_side(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_3 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[com_dd_library_one_side(a)]
---------filter((cast(experiment_id as DECIMALV3(38, 6)) = 73.000000))
-----------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_4 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[com_dd_library_one_side(a)]
---------PhysicalOlapScan[shunt_log_com_dd_library_one_side(b)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_distinct_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_distinct_through_join_one_side.out
deleted file mode 100644
index 69b42b6eedc..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_distinct_through_join_one_side.out
+++ /dev/null
@@ -1,237 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-1
-1
-1
-3
-
--- !groupby_pushdown_left_join --
-1
-1
-1
-3
-
--- !groupby_pushdown_right_join --
-1
-1
-1
-3
-
--- !groupby_pushdown_full_join --
-1
-1
-1
-3
-
--- !groupby_pushdown_left_semi_join --
-1
-1
-1
-3
-
--- !groupby_pushdown_left_anti_join --
-
--- !groupby_pushdown_complex_conditions --
-
--- !groupby_pushdown_with_aggregate --
-1 1
-1 2
-1 3
-3 2
-
--- !groupby_pushdown_subquery --
-
--- !groupby_pushdown_outer_join --
-1
-1
-1
-3
-
--- !groupby_pushdown_deep_subquery --
-
--- !groupby_pushdown_having --
-
--- !groupby_pushdown_mixed_aggregates --
-1 1
-1 2
-1 3
-3 6
-
--- !groupby_pushdown_multi_table_join --
-1
-1
-1
-
--- !groupby_pushdown_with_order_by --
-1
-1
-1
-3
-
--- !groupby_pushdown_multiple_equal_conditions --
-1
-1
-1
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-1 1
-2 1
-3 1
-
--- !groupby_pushdown_equal_conditions_non_aggregate --
-a 1
-b 1
-c 1
-
--- !groupby_pushdown_equal_conditions_non_aggregate_with_aggregate --
-a 1 1
-b 1 1
-c 1 1
-
--- !groupby_pushdown_with_where_clause --
-
--- !groupby_pushdown_varied_aggregates --
-1 1.5 1
-1 4.5 1
-1 7.5 1
-3 7 0
-
--- !groupby_pushdown_with_order_by_limit --
-1
-1
-1
-3
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-1
-1
-1
-
--- !groupby_pushdown_complex_join_condition --
-
--- !groupby_pushdown_function_processed_columns --
-0
-1
-1
-1
-
--- !groupby_pushdown_nested_queries --
-
--- !with_hint_groupby_pushdown_basic --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_left_join --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_right_join --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_full_join --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_left_semi_join --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_left_anti_join --
-
--- !with_hint_groupby_pushdown_complex_conditions --
-
--- !with_hint_groupby_pushdown_with_aggregate --
-1 1
-1 2
-1 3
-3 2
-
--- !with_hint_groupby_pushdown_subquery --
-
--- !with_hint_groupby_pushdown_outer_join --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_deep_subquery --
-
--- !with_hint_groupby_pushdown_having --
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-1 1
-1 2
-1 3
-3 6
-
--- !with_hint_groupby_pushdown_multi_table_join --
-1
-1
-1
-
--- !with_hint_groupby_pushdown_with_order_by --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-1
-1
-1
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-1 1
-2 1
-3 1
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate --
-a 1
-b 1
-c 1
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_with_aggregate --
-a 1 1
-b 1 1
-c 1 1
-
--- !with_hint_groupby_pushdown_with_where_clause --
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-1 1.5 1
-1 4.5 1
-1 7.5 1
-3 7 0
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-1
-1
-1
-3
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-1
-1
-1
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-0
-1
-1
-1
-
--- !with_hint_groupby_pushdown_nested_queries --
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
deleted file mode 100644
index 709d8d0eb82..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
+++ /dev/null
@@ -1,1032 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((count(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[count_t(t1)]
-----------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_multi_table_join_1 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-------PhysicalOlapScan[count_t(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[count_t(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1_alias)]
---------PhysicalOlapScan[count_t(t2_alias)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
---------filter((count_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[count_t]
-
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((count(*) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[count_t(t1)]
-----------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_multi_table_join_2 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-------PhysicalOlapScan[count_t(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[count_t(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
---------filter((count_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[count_t]
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((count(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[count_t(t1)]
-----------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join_1 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-------PhysicalOlapScan[count_t(t3)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[count_t(t1)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1_alias)]
---------PhysicalOlapScan[count_t(t2_alias)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
---------filter((count_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[count_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((count_t.score > 10))
-----------PhysicalOlapScan[count_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((count(*) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[count_t(t1)]
-----------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join_2 --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-------PhysicalOlapScan[count_t(t3)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[count_t(t1)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t(t1)]
-------------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[count_t(t1)]
---------PhysicalOlapScan[count_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t.id < 100))
-----------PhysicalOlapScan[count_t]
---------filter((count_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[count_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out
deleted file mode 100644
index b9a4c103a9b..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out
+++ /dev/null
@@ -1,1093 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------filter((count_t_one_side.score > 10))
-----------PhysicalOlapScan[count_t_one_side]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------filter((count_t_one_side.score > 10))
-----------PhysicalOlapScan[count_t_one_side]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((count(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[count_t_one_side(t1)]
-----------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-------PhysicalOlapScan[count_t_one_side(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[count_t_one_side(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1_alias)]
---------PhysicalOlapScan[count_t_one_side(t2_alias)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
---------filter((count_t_one_side.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
-
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------filter((count_t_one_side.score > 10))
-----------PhysicalOlapScan[count_t_one_side]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------filter((count_t_one_side.score > 10))
-----------PhysicalOlapScan[count_t_one_side]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((count(*) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[count_t_one_side(t1)]
-----------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-------PhysicalOlapScan[count_t_one_side(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[count_t_one_side(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
---------filter((count_t_one_side.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((count_t_one_side.score > 10))
-------------PhysicalOlapScan[count_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((count_t_one_side.score > 10))
-------------PhysicalOlapScan[count_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((count(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------hashAgg[GLOBAL]
-------------PhysicalOlapScan[count_t_one_side(t1)]
-----------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------PhysicalOlapScan[count_t_one_side(t3)]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((t1.score > 50))
-------------PhysicalOlapScan[count_t_one_side(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1_alias)]
---------PhysicalOlapScan[count_t_one_side(t2_alias)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
---------hashAgg[GLOBAL]
-----------filter((count_t_one_side.score > 20) and (t1.id < 100))
-------------PhysicalOlapScan[count_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((count_t_one_side.score > 10))
-------------PhysicalOlapScan[count_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((count_t_one_side.score > 10))
-------------PhysicalOlapScan[count_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((count(*) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------hashAgg[GLOBAL]
-------------PhysicalOlapScan[count_t_one_side(t1)]
-----------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------PhysicalOlapScan[count_t_one_side(t3)]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((t1.score > 50))
-------------PhysicalOlapScan[count_t_one_side(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[count_t_one_side(t1)]
-------------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[count_t_one_side(t1)]
---------PhysicalOlapScan[count_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((count_t_one_side.id < 100))
-----------PhysicalOlapScan[count_t_one_side]
---------hashAgg[GLOBAL]
-----------filter((count_t_one_side.score > 20) and (t1.id < 100))
-------------PhysicalOlapScan[count_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !shape --
-PhysicalResultSink
---PhysicalLimit[GLOBAL]
-----PhysicalLimit[LOCAL]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((dwd_tracking_sensor_init_tmp_ymd.dt = dw_user_b2c_tracking_info_tmp_ymd.dt) and (dwd_tracking_sensor_init_tmp_ymd.guid = dw_user_b2c_tracking_info_tmp_ymd.guid)) otherCondition=()
-------------filter((dwd_tracking_sensor_init_tmp_ymd.dt = '2024-08-19') and (dwd_tracking_sensor_init_tmp_ymd.tracking_type = 'click'))
---------------PhysicalOlapScan[dwd_tracking_sensor_init_tmp_ymd]
-------------hashAgg[GLOBAL]
---------------hashAgg[LOCAL]
-----------------filter((dw_user_b2c_tracking_info_tmp_ymd.dt = '2024-08-19') and (substring(first_visit_time, 1, 10) <= '2024-08-19'))
-------------------PhysicalOlapScan[dw_user_b2c_tracking_info_tmp_ymd]
-
-Hint log:
-Used: use_PUSH_DOWN_AGG_THROUGH_JOIN_ONE_SIDE
-UnUsed:
-SyntaxError:
-
--- !agg_pushed --
-2 是 2024-08-19
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out
deleted file mode 100644
index 721adabf798..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out
+++ /dev/null
@@ -1,592 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------filter((max_t.score > 10))
-----------PhysicalOlapScan[max_t]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------filter((max_t.score > 10))
-----------PhysicalOlapScan[max_t]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------filter((t1.score > 100))
-----------PhysicalOlapScan[max_t(t1)]
-
--- !groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[max_t(t1)]
-----------PhysicalOlapScan[max_t(t2)]
---------PhysicalOlapScan[max_t(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[max_t(t1)]
-------------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[max_t(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[max_t(t1)]
-------------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[max_t(t1_alias)]
---------PhysicalOlapScan[max_t(t2_alias)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((max_t.id < 100))
-----------PhysicalOlapScan[max_t]
---------filter((max_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[max_t]
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------hashAgg[GLOBAL]
-----------filter((max_t.score > 10))
-------------PhysicalOlapScan[max_t]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------hashAgg[GLOBAL]
-----------filter((max_t.score > 10))
-------------PhysicalOlapScan[max_t]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------hashAgg[GLOBAL]
-----------filter((t1.score > 100))
-------------PhysicalOlapScan[max_t(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------PhysicalOlapScan[max_t(t3)]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[max_t(t1)]
-------------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[max_t(t1)]
-------------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t2)]
---------hashAgg[GLOBAL]
-----------filter((t1.score > 50))
-------------PhysicalOlapScan[max_t(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[max_t(t1)]
-------------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1_alias)]
---------PhysicalOlapScan[max_t(t2_alias)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[max_t(t1)]
---------PhysicalOlapScan[max_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((max_t.id < 100))
-----------PhysicalOlapScan[max_t]
---------hashAgg[GLOBAL]
-----------filter((max_t.score > 20) and (t1.id < 100))
-------------PhysicalOlapScan[max_t]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_distinct_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_distinct_through_join_one_side.out
deleted file mode 100644
index 434c37d5d9a..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_distinct_through_join_one_side.out
+++ /dev/null
@@ -1,237 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-1
-1
-2
-3
-
--- !groupby_pushdown_left_join --
-1
-1
-2
-3
-
--- !groupby_pushdown_right_join --
-1
-1
-2
-3
-
--- !groupby_pushdown_full_join --
-1
-1
-2
-3
-
--- !groupby_pushdown_left_semi_join --
-1
-1
-2
-3
-
--- !groupby_pushdown_left_anti_join --
-
--- !groupby_pushdown_complex_conditions --
-
--- !groupby_pushdown_with_aggregate --
-1 1
-1 2
-2 2
-3 3
-
--- !groupby_pushdown_subquery --
-
--- !groupby_pushdown_outer_join --
-1
-1
-2
-3
-
--- !groupby_pushdown_deep_subquery --
-
--- !groupby_pushdown_having --
-
--- !groupby_pushdown_mixed_aggregates --
-1 1
-1 6
-2 2
-3 3
-
--- !groupby_pushdown_multi_table_join --
-1
-2
-3
-
--- !groupby_pushdown_with_order_by --
-1
-1
-2
-3
-
--- !groupby_pushdown_multiple_equal_conditions --
-1
-2
-3
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-1 1
-2 2
-3 3
-
--- !groupby_pushdown_equal_conditions_non_aggregate --
-a 1
-b 2
-c 3
-
--- !groupby_pushdown_equal_conditions_non_aggregate_with_aggregate --
-a 1 1
-b 2 2
-c 3 3
-
--- !groupby_pushdown_with_where_clause --
-
--- !groupby_pushdown_varied_aggregates --
-1 1.5 a
-1 7 \N
-2 4.5 b
-3 7.5 c
-
--- !groupby_pushdown_with_order_by_limit --
-1
-1
-2
-3
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-1
-2
-3
-
--- !groupby_pushdown_complex_join_condition --
-
--- !groupby_pushdown_function_processed_columns --
-\N
-1
-1
-1
-
--- !groupby_pushdown_nested_queries --
-
--- !with_hint_groupby_pushdown_basic --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_left_join --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_right_join --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_full_join --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_left_semi_join --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_left_anti_join --
-
--- !with_hint_groupby_pushdown_complex_conditions --
-
--- !with_hint_groupby_pushdown_with_aggregate --
-1 1
-1 2
-2 2
-3 3
-
--- !with_hint_groupby_pushdown_subquery --
-
--- !with_hint_groupby_pushdown_outer_join --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_deep_subquery --
-
--- !with_hint_groupby_pushdown_having --
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-1 1
-1 6
-2 2
-3 3
-
--- !with_hint_groupby_pushdown_multi_table_join --
-1
-2
-3
-
--- !with_hint_groupby_pushdown_with_order_by --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-1
-2
-3
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-1 1
-2 2
-3 3
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate --
-a 1
-b 2
-c 3
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_with_aggregate --
-a 1 1
-b 2 2
-c 3 3
-
--- !with_hint_groupby_pushdown_with_where_clause --
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-1 1.5 a
-1 7 \N
-2 4.5 b
-3 7.5 c
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-1
-1
-2
-3
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-1
-2
-3
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-\N
-1
-1
-1
-
--- !with_hint_groupby_pushdown_nested_queries --
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out
deleted file mode 100644
index 380636767f3..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out
+++ /dev/null
@@ -1,592 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((min_t.score > 10))
-----------PhysicalOlapScan[min_t]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((min_t.score > 10))
-----------PhysicalOlapScan[min_t]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((min(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[min_t(t1)]
-----------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[min_t(t1)]
-----------PhysicalOlapScan[min_t(t2)]
---------PhysicalOlapScan[min_t(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[min_t(t1)]
-------------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((t1.score > 50))
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[min_t(t1)]
-------------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[min_t(t1_alias)]
---------PhysicalOlapScan[min_t(t2_alias)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((min_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[min_t]
---------filter((min_t.id < 100))
-----------PhysicalOlapScan[min_t]
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------filter((min_t.score > 10))
-------------PhysicalOlapScan[min_t]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------filter((min_t.score > 10))
-------------PhysicalOlapScan[min_t]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((min(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------hashAgg[GLOBAL]
-------------PhysicalOlapScan[min_t(t1)]
-----------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[min_t(t1)]
-------------PhysicalOlapScan[min_t(t2)]
-------PhysicalOlapScan[min_t(t3)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[min_t(t1)]
-------------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------filter((t1.score > 50))
-------------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[min_t(t1)]
-------------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1_alias)]
---------PhysicalOlapScan[min_t(t2_alias)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[min_t(t1)]
---------PhysicalOlapScan[min_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------filter((min_t.score > 20) and (t1.id < 100))
-------------PhysicalOlapScan[min_t]
---------filter((min_t.id < 100))
-----------PhysicalOlapScan[min_t]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_distinct_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_distinct_through_join_one_side.out
deleted file mode 100644
index f520240cc73..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_distinct_through_join_one_side.out
+++ /dev/null
@@ -1,231 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-1
-2
-3
-6
-
--- !groupby_pushdown_left_join --
-1
-2
-3
-6
-
--- !groupby_pushdown_right_join --
-1
-2
-3
-6
-
--- !groupby_pushdown_full_join --
-1
-2
-3
-6
-
--- !groupby_pushdown_left_semi_join --
-1
-2
-3
-6
-
--- !groupby_pushdown_left_anti_join --
-
--- !groupby_pushdown_complex_conditions --
-
--- !groupby_pushdown_with_aggregate --
-1 1
-2 2
-3 3
-6 2
-
--- !groupby_pushdown_subquery --
-
--- !groupby_pushdown_outer_join --
-1
-2
-3
-6
-
--- !groupby_pushdown_deep_subquery --
-
--- !groupby_pushdown_having --
-
--- !groupby_pushdown_mixed_aggregates --
-1 1
-2 2
-3 3
-6 6
-
--- !groupby_pushdown_multi_table_join --
-1
-2
-3
-
--- !groupby_pushdown_with_order_by --
-1
-2
-3
-6
-
--- !groupby_pushdown_multiple_equal_conditions --
-1
-2
-3
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-1 1
-2 2
-3 3
-
--- !groupby_pushdown_equal_conditions_non_aggregate --
-a 1
-b 2
-c 3
-
--- !groupby_pushdown_equal_conditions_non_aggregate_with_aggregate --
-a 1 1
-b 2 2
-c 3 3
-
--- !groupby_pushdown_with_where_clause --
-
--- !groupby_pushdown_varied_aggregates --
-1
-2
-3
-6
-
--- !groupby_pushdown_with_order_by_limit --
-1
-2
-3
-6
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-1
-2
-3
-
--- !groupby_pushdown_complex_join_condition --
-
--- !groupby_pushdown_function_processed_columns --
-1
-2
-3
-6
-
--- !groupby_pushdown_nested_queries --
-
--- !with_hint_groupby_pushdown_basic --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_left_join --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_right_join --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_full_join --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_left_semi_join --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_left_anti_join --
-
--- !with_hint_groupby_pushdown_complex_conditions --
-
--- !with_hint_groupby_pushdown_with_aggregate --
-1 1
-2 2
-3 3
-6 2
-
--- !with_hint_groupby_pushdown_subquery --
-
--- !with_hint_groupby_pushdown_outer_join --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_deep_subquery --
-
--- !with_hint_groupby_pushdown_having --
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-1 1
-2 2
-3 3
-6 6
-
--- !with_hint_groupby_pushdown_multi_table_join --
-1
-2
-3
-
--- !with_hint_groupby_pushdown_with_order_by --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-1
-2
-3
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-1 1
-2 2
-3 3
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate --
-a 1
-b 2
-c 3
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_with_aggregate --
-a 1 1
-b 2 2
-c 3 3
-
--- !with_hint_groupby_pushdown_with_where_clause --
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-1
-2
-3
-6
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-1
-2
-3
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-
--- !with_hint_groupby_pushdown_nested_queries --
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
deleted file mode 100644
index d7df3cbed86..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
+++ /dev/null
@@ -1,569 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t2)]
---------filter((sum_t.score > 10))
-----------PhysicalOlapScan[sum_t]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t2)]
---------filter((sum_t.score > 10))
-----------PhysicalOlapScan[sum_t]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((sum(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[sum_t(t1)]
-----------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-------PhysicalOlapScan[sum_t(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[sum_t(t1)]
-------------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[sum_t(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[sum_t(t1)]
-------------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1_alias)]
---------PhysicalOlapScan[sum_t(t2_alias)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t.id < 100))
-----------PhysicalOlapScan[sum_t]
---------filter((sum_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[sum_t]
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t2)]
---------filter((sum_t.score > 10))
-----------PhysicalOlapScan[sum_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t2)]
---------filter((sum_t.score > 10))
-----------PhysicalOlapScan[sum_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((sum(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[sum_t(t1)]
-----------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-------PhysicalOlapScan[sum_t(t3)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[sum_t(t1)]
-------------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[sum_t(t1)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[sum_t(t1)]
-------------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1_alias)]
---------PhysicalOlapScan[sum_t(t2_alias)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t(t1)]
---------PhysicalOlapScan[sum_t(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t.id < 100))
-----------PhysicalOlapScan[sum_t]
---------filter((sum_t.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[sum_t]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join
-SyntaxError:
-
diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out
deleted file mode 100644
index ff4de95e6c8..00000000000
--- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out
+++ /dev/null
@@ -1,592 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t2)]
---------filter((sum_t_one_side.score > 10))
-----------PhysicalOlapScan[sum_t_one_side]
-
--- !groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t2)]
---------filter((sum_t_one_side.score > 10))
-----------PhysicalOlapScan[sum_t_one_side]
-
--- !groupby_pushdown_having --
-PhysicalResultSink
---filter((sum(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------PhysicalOlapScan[sum_t_one_side(t1)]
-----------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-------PhysicalOlapScan[sum_t_one_side(t3)]
-
--- !groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[sum_t_one_side(t1)]
-------------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t2)]
---------filter((t1.score > 50))
-----------PhysicalOlapScan[sum_t_one_side(t1)]
-
--- !groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------PhysicalOlapScan[sum_t_one_side(t1)]
-------------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1_alias)]
---------PhysicalOlapScan[sum_t_one_side(t2_alias)]
-
--- !groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
--- !groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t_one_side.id < 100))
-----------PhysicalOlapScan[sum_t_one_side]
---------filter((sum_t_one_side.score > 20) and (t1.id < 100))
-----------PhysicalOlapScan[sum_t_one_side]
-
--- !with_hint_groupby_pushdown_basic --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------filter((t2.score < 100))
-----------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_right_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_full_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_semi_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_left_anti_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((sum_t_one_side.score > 10))
-------------PhysicalOlapScan[sum_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_outer_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_deep_subquery --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((sum_t_one_side.score > 10))
-------------PhysicalOlapScan[sum_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_having --
-PhysicalResultSink
---filter((sum(t1.score) > 100))
-----hashAgg[GLOBAL]
-------hashAgg[LOCAL]
---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-----------hashAgg[GLOBAL]
-------------PhysicalOlapScan[sum_t_one_side(t1)]
-----------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_mixed_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multi_table_join --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=()
-------PhysicalOlapScan[sum_t_one_side(t3)]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[sum_t_one_side(t1)]
-------------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by --
-PhysicalResultSink
---PhysicalQuickSort[MERGE_SORT]
-----PhysicalQuickSort[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[sum_t_one_side(t1)]
-------------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_where_clause --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t2)]
---------hashAgg[GLOBAL]
-----------filter((t1.score > 50))
-------------PhysicalOlapScan[sum_t_one_side(t1)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_varied_aggregates --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_with_order_by_limit --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalTopN[LOCAL_SORT]
-------hashAgg[GLOBAL]
---------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
-------------hashAgg[GLOBAL]
---------------PhysicalOlapScan[sum_t_one_side(t1)]
-------------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_alias_multiple_equal_conditions --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=()
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1_alias)]
---------PhysicalOlapScan[sum_t_one_side(t2_alias)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_complex_join_condition --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name)))
---------hashAgg[GLOBAL]
-----------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
--- !with_hint_groupby_pushdown_function_processed_columns --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------PhysicalOlapScan[sum_t_one_side(t1)]
---------PhysicalOlapScan[sum_t_one_side(t2)]
-
-Hint log:
-Used:
-UnUsed: use_push_down_agg_through_join_one_side
-SyntaxError:
-
--- !with_hint_groupby_pushdown_nested_queries --
-PhysicalResultSink
---hashAgg[GLOBAL]
-----hashAgg[LOCAL]
-------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=()
---------filter((sum_t_one_side.id < 100))
-----------PhysicalOlapScan[sum_t_one_side]
---------hashAgg[GLOBAL]
-----------filter((sum_t_one_side.score > 20) and (t1.id < 100))
-------------PhysicalOlapScan[sum_t_one_side]
-
-Hint log:
-Used: use_push_down_agg_through_join_one_side
-UnUsed:
-SyntaxError:
-
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query14.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query14.out
index 9c4d0b19325..c773f177870 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query14.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query14.out
@@ -82,18 +82,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=()
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=()
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF10 d_date_sk->[ss_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=()
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF11 d_date_sk->[ss_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=()
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF11
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item]
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -104,18 +108,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=()
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=()
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF13 d_date_sk->[cs_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF13
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=()
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF14 d_date_sk->[cs_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=()
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF14
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item]
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -126,18 +134,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=()
---------------------------------hashJoin[LEFT_SEMI_JOIN shuffle] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=()
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF16 d_date_sk->[ws_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=()
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF17 d_date_sk->[ws_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=()
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF17
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item]
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query2.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query2.out
index 12167efa748..41ad24ad066 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query2.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query2.out
@@ -6,16 +6,20 @@ PhysicalCteAnchor ( cteId=CTEId#1 )
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
-------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = wscs.sold_date_sk)) otherCondition=()
---------------PhysicalUnion
-----------------PhysicalDistribute[DistributionSpecExecutionAny]
-------------------PhysicalProject
---------------------PhysicalOlapScan[web_sales]
-----------------PhysicalDistribute[DistributionSpecExecutionAny]
-------------------PhysicalProject
---------------------PhysicalOlapScan[catalog_sales]
+------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = wscs.sold_date_sk)) otherCondition=() build RFs:RF0 sold_date_sk->[d_date_sk]
--------------PhysicalProject
-----------------PhysicalOlapScan[date_dim]
+----------------PhysicalOlapScan[date_dim] apply RFs: RF0
+--------------PhysicalUnion
+----------------hashAgg[GLOBAL]
+------------------PhysicalDistribute[DistributionSpecHash]
+--------------------hashAgg[LOCAL]
+----------------------PhysicalProject
+------------------------PhysicalOlapScan[web_sales]
+----------------hashAgg[GLOBAL]
+------------------PhysicalDistribute[DistributionSpecHash]
+--------------------hashAgg[LOCAL]
+----------------------PhysicalProject
+------------------------PhysicalOlapScan[catalog_sales]
--PhysicalResultSink
----PhysicalQuickSort[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query3.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query3.out
index e9c6ec79c33..fae84ff1a42 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query3.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query3.out
@@ -9,15 +9,18 @@ PhysicalResultSink
------------PhysicalDistribute[DistributionSpecHash]
--------------hashAgg[LOCAL]
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF1 i_item_sk->[ss_item_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
-------------------------PhysicalProject
---------------------------filter((item.i_manufact_id = 816))
-----------------------------PhysicalOlapScan[item]
+--------------------------filter((dt.d_moy = 11))
+----------------------------PhysicalOlapScan[date_dim(dt)]
--------------------PhysicalProject
-----------------------filter((dt.d_moy = 11))
-------------------------PhysicalOlapScan[date_dim(dt)]
+----------------------filter((item.i_manufact_id = 816))
+------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query31.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query31.out
index af4392c42a7..89da394c704 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query31.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query31.out
@@ -9,9 +9,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------PhysicalProject
--------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=()
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[store_sales] apply RFs: RF0
+------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------------PhysicalProject
----------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
------------------------PhysicalOlapScan[date_dim]
@@ -26,9 +29,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------PhysicalProject
----------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=()
------------------PhysicalProject
---------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[web_sales] apply RFs: RF2
+--------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
+----------------------hashAgg[GLOBAL]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2
----------------------PhysicalProject
------------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------------PhysicalOlapScan[date_dim]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query42.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query42.out
index b2a262da465..0bb9347e187 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query42.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query42.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 1))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query43.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query43.out
index 37ab89010ef..38ee41c557e 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query43.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query43.out
@@ -10,9 +10,12 @@ PhysicalResultSink
--------------PhysicalProject
----------------hashJoin[INNER_JOIN broadcast] hashCondition=((store.s_store_sk = store_sales.ss_store_sk)) otherCondition=() build RFs:RF1 s_store_sk->[ss_store_sk]
------------------PhysicalProject
---------------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+--------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+----------------------hashAgg[GLOBAL]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
----------------------PhysicalProject
------------------------filter((date_dim.d_year = 2000))
--------------------------PhysicalOlapScan[date_dim]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query52.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query52.out
index ddcc09c49f9..0d3bcc76883 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query52.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query52.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 1))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query55.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query55.out
index e24470e9606..94b0bfd66b3 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query55.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query55.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 100))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query59.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query59.out
index 215b62a9180..12ffd327e84 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query59.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query59.out
@@ -6,9 +6,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
-------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
---------------PhysicalProject
-----------------PhysicalOlapScan[store_sales]
+------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
+--------------hashAgg[GLOBAL]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------hashAgg[LOCAL]
+--------------------PhysicalProject
+----------------------PhysicalOlapScan[store_sales]
--------------PhysicalProject
----------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
diff --git a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query64.out b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query64.out
index 92a15d7ac88..28df68528b5 100644
--- a/regression-test/data/shape_check/tpcds_sf100/rf_prune/query64.out
+++ b/regression-test/data/shape_check/tpcds_sf100/rf_prune/query64.out
@@ -7,86 +7,85 @@ PhysicalCteAnchor ( cteId=CTEId#1 )
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
---------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF19 i_item_sk->[cr_item_sk,cs_item_sk,sr_item_sk,ss_item_sk]
+--------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_shipto_date_sk = d3.d_date_sk)) otherCondition=()
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd2.hd_income_band_sk = ib2.ib_income_band_sk)) otherCondition=()
+------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_sales_date_sk = d2.d_date_sk)) otherCondition=()
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd1.hd_income_band_sk = ib1.ib_income_band_sk)) otherCondition=()
+----------------------hashJoin[INNER_JOIN shuffle] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk)) otherCondition=(( not (cd_marital_status = cd_marital_status))) build RFs:RF17 ss_customer_sk->[c_customer_sk]
------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_current_addr_sk = ad2.ca_address_sk)) otherCondition=()
+--------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((customer.c_current_addr_sk = ad2.ca_address_sk)) otherCondition=()
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_addr_sk = ad1.ca_address_sk)) otherCondition=()
+------------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((customer.c_current_cdemo_sk = cd2.cd_demo_sk)) otherCondition=()
--------------------------------PhysicalProject
----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_current_hdemo_sk = hd2.hd_demo_sk)) otherCondition=()
------------------------------------PhysicalProject
---------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_hdemo_sk = hd1.hd_demo_sk)) otherCondition=()
+--------------------------------------PhysicalOlapScan[customer] apply RFs: RF17
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd2.hd_income_band_sk = ib2.ib_income_band_sk)) otherCondition=()
----------------------------------------PhysicalProject
-------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_promo_sk = promotion.p_promo_sk)) otherCondition=()
---------------------------------------------PhysicalProject
-----------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_current_cdemo_sk = cd2.cd_demo_sk)) otherCondition=(( not (cd_marital_status = cd_marital_status)))
-------------------------------------------------PhysicalProject
---------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_cdemo_sk = cd1.cd_demo_sk)) otherCondition=()
-----------------------------------------------------PhysicalProject
-------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_shipto_date_sk = d3.d_date_sk)) otherCondition=()
---------------------------------------------------------PhysicalProject
-----------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_sales_date_sk = d2.d_date_sk)) otherCondition=()
-------------------------------------------------------------PhysicalProject
---------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk)) otherCondition=()
-----------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=()
---------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = d1.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk]
-------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cs_ui.cs_item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[sr_item_sk,ss_item_sk]
-----------------------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and (store_sales.ss_ticket_number = store_returns.sr_ticket_number)) otherCondition=()
---------------------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF4 RF5 RF19
---------------------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------------------PhysicalOlapScan[store_returns] apply RFs: RF4 RF19
-----------------------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------------------filter((sale > (2 * refund)))
---------------------------------------------------------------------------------hashAgg[GLOBAL]
-----------------------------------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------------------------------------------------------hashAgg[LOCAL]
---------------------------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=()
-------------------------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF19
-------------------------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF19
-------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------filter(d_year IN (2001, 2002))
-----------------------------------------------------------------------------PhysicalOlapScan[date_dim(d1)]
---------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------PhysicalOlapScan[store]
-----------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------PhysicalOlapScan[customer]
-------------------------------------------------------------PhysicalProject
---------------------------------------------------------------PhysicalOlapScan[date_dim(d2)]
---------------------------------------------------------PhysicalProject
-----------------------------------------------------------PhysicalOlapScan[date_dim(d3)]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------PhysicalOlapScan[customer_demographics(cd1)]
-------------------------------------------------PhysicalProject
---------------------------------------------------PhysicalOlapScan[customer_demographics(cd2)]
---------------------------------------------PhysicalProject
-----------------------------------------------PhysicalOlapScan[promotion]
+------------------------------------------PhysicalOlapScan[household_demographics(hd2)]
----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[household_demographics(hd1)]
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[household_demographics(hd2)]
+------------------------------------------PhysicalOlapScan[income_band(ib2)]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[customer_address(ad1)]
+----------------------------------PhysicalOlapScan[customer_demographics(cd2)]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[customer_address(ad2)]
------------------------PhysicalProject
---------------------------PhysicalOlapScan[income_band(ib1)]
+--------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and (store_sales.ss_ticket_number = store_returns.sr_ticket_number)) otherCondition=() build RFs:RF11 ss_item_sk->[sr_item_sk];RF12 ss_ticket_number->[sr_ticket_number]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[store_returns] apply RFs: RF11 RF12
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((store_sales.ss_addr_sk = ad1.ca_address_sk)) otherCondition=() build RFs:RF10 ss_addr_sk->[ca_address_sk]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[customer_address(ad1)] apply RFs: RF10
+--------------------------------PhysicalProject
+----------------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((store_sales.ss_cdemo_sk = cd1.cd_demo_sk)) otherCondition=() build RFs:RF9 ss_cdemo_sk->[cd_demo_sk]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalOlapScan[customer_demographics(cd1)] apply RFs: RF9
+------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF8 i_item_sk->[cr_item_sk,cs_item_sk,ss_item_sk]
+--------------------------------------PhysicalProject
+----------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_promo_sk = promotion.p_promo_sk)) otherCondition=()
+------------------------------------------PhysicalProject
+--------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=()
+----------------------------------------------PhysicalProject
+------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd1.hd_income_band_sk = ib1.ib_income_band_sk)) otherCondition=()
+--------------------------------------------------PhysicalProject
+----------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_hdemo_sk = hd1.hd_demo_sk)) otherCondition=()
+------------------------------------------------------PhysicalProject
+--------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cs_ui.cs_item_sk)) otherCondition=() build RFs:RF3 cs_item_sk->[ss_item_sk]
+----------------------------------------------------------PhysicalProject
+------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = d1.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+--------------------------------------------------------------PhysicalProject
+----------------------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 RF3 RF8
+--------------------------------------------------------------PhysicalProject
+----------------------------------------------------------------filter(d_year IN (2001, 2002))
+------------------------------------------------------------------PhysicalOlapScan[date_dim(d1)]
+----------------------------------------------------------PhysicalProject
+------------------------------------------------------------filter((sale > (2 * refund)))
+--------------------------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------------------------hashAgg[LOCAL]
+--------------------------------------------------------------------PhysicalProject
+----------------------------------------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=()
+------------------------------------------------------------------------PhysicalProject
+--------------------------------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF8
+------------------------------------------------------------------------PhysicalProject
+--------------------------------------------------------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF8
+------------------------------------------------------PhysicalProject
+--------------------------------------------------------PhysicalOlapScan[household_demographics(hd1)]
+--------------------------------------------------PhysicalProject
+----------------------------------------------------PhysicalOlapScan[income_band(ib1)]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[store]
+------------------------------------------PhysicalProject
+--------------------------------------------PhysicalOlapScan[promotion]
+--------------------------------------PhysicalProject
+----------------------------------------filter((item.i_current_price <= 33.00) and (item.i_current_price >= 24.00) and i_color IN ('blanched', 'brown', 'burlywood', 'chocolate', 'drab', 'medium'))
+------------------------------------------PhysicalOlapScan[item]
--------------------PhysicalProject
-----------------------PhysicalOlapScan[income_band(ib2)]
+----------------------PhysicalOlapScan[date_dim(d2)]
----------------PhysicalProject
-------------------filter((item.i_current_price <= 33.00) and (item.i_current_price >= 24.00) and i_color IN ('blanched', 'brown', 'burlywood', 'chocolate', 'drab', 'medium'))
---------------------PhysicalOlapScan[item]
+------------------PhysicalOlapScan[date_dim(d3)]
--PhysicalResultSink
----PhysicalQuickSort[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query14.out b/regression-test/data/shape_check/tpcds_sf100/shape/query14.out
index cbcaf12a80e..7e98074dd3d 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query14.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query14.out
@@ -82,18 +82,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF12 i_item_sk->[ss_item_sk,ss_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF11 ss_item_sk->[ss_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF10 d_date_sk->[ss_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10 RF11 RF12
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF12
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF12 ss_item_sk->[i_item_sk,ss_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF11 d_date_sk->[ss_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF10 i_item_sk->[ss_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10 RF11 RF12
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF12
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -104,18 +108,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF15 i_item_sk->[cs_item_sk,ss_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF14 ss_item_sk->[cs_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF13 d_date_sk->[cs_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF13 RF14 RF15
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF15
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF15 ss_item_sk->[cs_item_sk,i_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF14 d_date_sk->[cs_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF13 i_item_sk->[cs_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF13 RF14 RF15
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF15
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -126,18 +134,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF18 i_item_sk->[ss_item_sk,ws_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN shuffle] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF17 ss_item_sk->[ws_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF16 d_date_sk->[ws_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16 RF17 RF18
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF18
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF18 ss_item_sk->[i_item_sk,ws_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF17 d_date_sk->[ws_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF16 i_item_sk->[ws_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16 RF17 RF18
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF18
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query2.out b/regression-test/data/shape_check/tpcds_sf100/shape/query2.out
index b9857d34997..41ad24ad066 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query2.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query2.out
@@ -6,16 +6,20 @@ PhysicalCteAnchor ( cteId=CTEId#1 )
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
-------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = wscs.sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[cs_sold_date_sk,ws_sold_date_sk]
---------------PhysicalUnion
-----------------PhysicalDistribute[DistributionSpecExecutionAny]
-------------------PhysicalProject
---------------------PhysicalOlapScan[web_sales] apply RFs: RF0
-----------------PhysicalDistribute[DistributionSpecExecutionAny]
-------------------PhysicalProject
---------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0
+------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = wscs.sold_date_sk)) otherCondition=() build RFs:RF0 sold_date_sk->[d_date_sk]
--------------PhysicalProject
-----------------PhysicalOlapScan[date_dim]
+----------------PhysicalOlapScan[date_dim] apply RFs: RF0
+--------------PhysicalUnion
+----------------hashAgg[GLOBAL]
+------------------PhysicalDistribute[DistributionSpecHash]
+--------------------hashAgg[LOCAL]
+----------------------PhysicalProject
+------------------------PhysicalOlapScan[web_sales]
+----------------hashAgg[GLOBAL]
+------------------PhysicalDistribute[DistributionSpecHash]
+--------------------hashAgg[LOCAL]
+----------------------PhysicalProject
+------------------------PhysicalOlapScan[catalog_sales]
--PhysicalResultSink
----PhysicalQuickSort[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query3.out b/regression-test/data/shape_check/tpcds_sf100/shape/query3.out
index e9c6ec79c33..fae84ff1a42 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query3.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query3.out
@@ -9,15 +9,18 @@ PhysicalResultSink
------------PhysicalDistribute[DistributionSpecHash]
--------------hashAgg[LOCAL]
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF1 i_item_sk->[ss_item_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
-------------------------PhysicalProject
---------------------------filter((item.i_manufact_id = 816))
-----------------------------PhysicalOlapScan[item]
+--------------------------filter((dt.d_moy = 11))
+----------------------------PhysicalOlapScan[date_dim(dt)]
--------------------PhysicalProject
-----------------------filter((dt.d_moy = 11))
-------------------------PhysicalOlapScan[date_dim(dt)]
+----------------------filter((item.i_manufact_id = 816))
+------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query31.out b/regression-test/data/shape_check/tpcds_sf100/shape/query31.out
index d45dad8dca8..ed4c26b9893 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query31.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query31.out
@@ -9,9 +9,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------PhysicalProject
--------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk]
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
--------------------PhysicalProject
----------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
------------------------PhysicalOlapScan[date_dim]
@@ -26,9 +29,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------PhysicalProject
----------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[ws_bill_addr_sk]
------------------PhysicalProject
---------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
+--------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
+----------------------hashAgg[GLOBAL]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
----------------------PhysicalProject
------------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------------PhysicalOlapScan[date_dim]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query42.out b/regression-test/data/shape_check/tpcds_sf100/shape/query42.out
index b2a262da465..0bb9347e187 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query42.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query42.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 1))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query43.out b/regression-test/data/shape_check/tpcds_sf100/shape/query43.out
index 37ab89010ef..38ee41c557e 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query43.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query43.out
@@ -10,9 +10,12 @@ PhysicalResultSink
--------------PhysicalProject
----------------hashJoin[INNER_JOIN broadcast] hashCondition=((store.s_store_sk = store_sales.ss_store_sk)) otherCondition=() build RFs:RF1 s_store_sk->[ss_store_sk]
------------------PhysicalProject
---------------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+--------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+----------------------hashAgg[GLOBAL]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
----------------------PhysicalProject
------------------------filter((date_dim.d_year = 2000))
--------------------------PhysicalOlapScan[date_dim]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query52.out b/regression-test/data/shape_check/tpcds_sf100/shape/query52.out
index ddcc09c49f9..0d3bcc76883 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query52.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query52.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 1))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query55.out b/regression-test/data/shape_check/tpcds_sf100/shape/query55.out
index e24470e9606..94b0bfd66b3 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query55.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query55.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 100))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query59.out b/regression-test/data/shape_check/tpcds_sf100/shape/query59.out
index f28f49bf99a..f5fc81e7ddb 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query59.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query59.out
@@ -6,9 +6,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
-------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
---------------PhysicalProject
-----------------PhysicalOlapScan[store_sales] apply RFs: RF0
+------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+--------------hashAgg[GLOBAL]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------hashAgg[LOCAL]
+--------------------PhysicalProject
+----------------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------PhysicalProject
----------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
diff --git a/regression-test/data/shape_check/tpcds_sf100/shape/query64.out b/regression-test/data/shape_check/tpcds_sf100/shape/query64.out
index 9c9971d7429..9b91b5a6891 100644
--- a/regression-test/data/shape_check/tpcds_sf100/shape/query64.out
+++ b/regression-test/data/shape_check/tpcds_sf100/shape/query64.out
@@ -7,86 +7,85 @@ PhysicalCteAnchor ( cteId=CTEId#1 )
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
---------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF19 i_item_sk->[cr_item_sk,cs_item_sk,sr_item_sk,ss_item_sk]
+--------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_shipto_date_sk = d3.d_date_sk)) otherCondition=() build RFs:RF19 d_date_sk->[c_first_shipto_date_sk]
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd2.hd_income_band_sk = ib2.ib_income_band_sk)) otherCondition=() build RFs:RF18 ib_income_band_sk->[hd_income_band_sk]
+------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_sales_date_sk = d2.d_date_sk)) otherCondition=() build RFs:RF18 d_date_sk->[c_first_sales_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd1.hd_income_band_sk = ib1.ib_income_band_sk)) otherCondition=() build RFs:RF17 ib_income_band_sk->[hd_income_band_sk]
+----------------------hashJoin[INNER_JOIN shuffle] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk)) otherCondition=(( not (cd_marital_status = cd_marital_status))) build RFs:RF17 ss_customer_sk->[c_customer_sk]
------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_current_addr_sk = ad2.ca_address_sk)) otherCondition=() build RFs:RF16 ca_address_sk->[c_current_addr_sk]
+--------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((customer.c_current_addr_sk = ad2.ca_address_sk)) otherCondition=() build RFs:RF16 ca_address_sk->[c_current_addr_sk]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_addr_sk = ad1.ca_address_sk)) otherCondition=() build RFs:RF15 ca_address_sk->[ss_addr_sk]
+------------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((customer.c_current_cdemo_sk = cd2.cd_demo_sk)) otherCondition=() build RFs:RF15 cd_demo_sk->[c_current_cdemo_sk]
--------------------------------PhysicalProject
----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_current_hdemo_sk = hd2.hd_demo_sk)) otherCondition=() build RFs:RF14 hd_demo_sk->[c_current_hdemo_sk]
------------------------------------PhysicalProject
---------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_hdemo_sk = hd1.hd_demo_sk)) otherCondition=() build RFs:RF13 hd_demo_sk->[ss_hdemo_sk]
+--------------------------------------PhysicalOlapScan[customer] apply RFs: RF14 RF15 RF16 RF17 RF18 RF19
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd2.hd_income_band_sk = ib2.ib_income_band_sk)) otherCondition=() build RFs:RF13 ib_income_band_sk->[hd_income_band_sk]
----------------------------------------PhysicalProject
-------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_promo_sk = promotion.p_promo_sk)) otherCondition=() build RFs:RF12 p_promo_sk->[ss_promo_sk]
---------------------------------------------PhysicalProject
-----------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_current_cdemo_sk = cd2.cd_demo_sk)) otherCondition=(( not (cd_marital_status = cd_marital_status))) build RFs:RF11 cd_demo_sk->[c_current_cdemo_sk]
-------------------------------------------------PhysicalProject
---------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_cdemo_sk = cd1.cd_demo_sk)) otherCondition=() build RFs:RF10 cd_demo_sk->[ss_cdemo_sk]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_shipto_date_sk = d3.d_date_sk)) otherCondition=() build RFs:RF9 d_date_sk->[c_first_shipto_date_sk]
---------------------------------------------------------PhysicalProject
-----------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((customer.c_first_sales_date_sk = d2.d_date_sk)) otherCondition=() build RFs:RF8 d_date_sk->[c_first_sales_date_sk]
-------------------------------------------------------------PhysicalProject
---------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk)) otherCondition=() build RFs:RF7 c_customer_sk->[ss_customer_sk]
-----------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() build RFs:RF6 s_store_sk->[ss_store_sk]
---------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = d1.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk]
-------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cs_ui.cs_item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[sr_item_sk,ss_item_sk]
-----------------------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and (store_sales.ss_ticket_number = store_returns.sr_ticket_number)) otherCondition=() build RFs:RF2 sr_item_sk->[ss_item_sk];RF3 sr_ticket_number->[ss_ticket_number]
---------------------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 RF3 RF4 RF5 RF6 RF7 RF10 RF12 RF13 RF15 RF19
---------------------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------------------PhysicalOlapScan[store_returns] apply RFs: RF4 RF19
-----------------------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------------------filter((sale > (2 * refund)))
---------------------------------------------------------------------------------hashAgg[GLOBAL]
-----------------------------------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------------------------------------------------------hashAgg[LOCAL]
---------------------------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=() build RFs:RF0 cr_item_sk->[cs_item_sk];RF1 cr_order_number->[cs_order_number]
-------------------------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF19
-------------------------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF19
-------------------------------------------------------------------------PhysicalProject
---------------------------------------------------------------------------filter(d_year IN (2001, 2002))
-----------------------------------------------------------------------------PhysicalOlapScan[date_dim(d1)]
---------------------------------------------------------------------PhysicalProject
-----------------------------------------------------------------------PhysicalOlapScan[store]
-----------------------------------------------------------------PhysicalProject
-------------------------------------------------------------------PhysicalOlapScan[customer] apply RFs: RF8 RF9 RF11 RF14 RF16
-------------------------------------------------------------PhysicalProject
---------------------------------------------------------------PhysicalOlapScan[date_dim(d2)]
---------------------------------------------------------PhysicalProject
-----------------------------------------------------------PhysicalOlapScan[date_dim(d3)]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------PhysicalOlapScan[customer_demographics(cd1)]
-------------------------------------------------PhysicalProject
---------------------------------------------------PhysicalOlapScan[customer_demographics(cd2)]
---------------------------------------------PhysicalProject
-----------------------------------------------PhysicalOlapScan[promotion]
+------------------------------------------PhysicalOlapScan[household_demographics(hd2)] apply RFs: RF13
----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[household_demographics(hd1)] apply RFs: RF17
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[household_demographics(hd2)] apply RFs: RF18
+------------------------------------------PhysicalOlapScan[income_band(ib2)]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[customer_address(ad1)]
+----------------------------------PhysicalOlapScan[customer_demographics(cd2)]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[customer_address(ad2)]
------------------------PhysicalProject
---------------------------PhysicalOlapScan[income_band(ib1)]
+--------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and (store_sales.ss_ticket_number = store_returns.sr_ticket_number)) otherCondition=() build RFs:RF11 ss_item_sk->[sr_item_sk];RF12 ss_ticket_number->[sr_ticket_number]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[store_returns] apply RFs: RF11 RF12
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((store_sales.ss_addr_sk = ad1.ca_address_sk)) otherCondition=() build RFs:RF10 ss_addr_sk->[ca_address_sk]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[customer_address(ad1)] apply RFs: RF10
+--------------------------------PhysicalProject
+----------------------------------hashJoin[INNER_JOIN shuffle] hashCondition=((store_sales.ss_cdemo_sk = cd1.cd_demo_sk)) otherCondition=() build RFs:RF9 ss_cdemo_sk->[cd_demo_sk]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalOlapScan[customer_demographics(cd1)] apply RFs: RF9
+------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF8 i_item_sk->[cr_item_sk,cs_item_sk,ss_item_sk]
+--------------------------------------PhysicalProject
+----------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_promo_sk = promotion.p_promo_sk)) otherCondition=() build RFs:RF7 p_promo_sk->[ss_promo_sk]
+------------------------------------------PhysicalProject
+--------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() build RFs:RF6 s_store_sk->[ss_store_sk]
+----------------------------------------------PhysicalProject
+------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((hd1.hd_income_band_sk = ib1.ib_income_band_sk)) otherCondition=() build RFs:RF5 ib_income_band_sk->[hd_income_band_sk]
+--------------------------------------------------PhysicalProject
+----------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_hdemo_sk = hd1.hd_demo_sk)) otherCondition=() build RFs:RF4 hd_demo_sk->[ss_hdemo_sk]
+------------------------------------------------------PhysicalProject
+--------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cs_ui.cs_item_sk)) otherCondition=() build RFs:RF3 cs_item_sk->[ss_item_sk]
+----------------------------------------------------------PhysicalProject
+------------------------------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = d1.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+--------------------------------------------------------------PhysicalProject
+----------------------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 RF3 RF4 RF6 RF7 RF8
+--------------------------------------------------------------PhysicalProject
+----------------------------------------------------------------filter(d_year IN (2001, 2002))
+------------------------------------------------------------------PhysicalOlapScan[date_dim(d1)]
+----------------------------------------------------------PhysicalProject
+------------------------------------------------------------filter((sale > (2 * refund)))
+--------------------------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------------------------hashAgg[LOCAL]
+--------------------------------------------------------------------PhysicalProject
+----------------------------------------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=() build RFs:RF0 cr_item_sk->[cs_item_sk];RF1 cr_order_number->[cs_order_number]
+------------------------------------------------------------------------PhysicalProject
+--------------------------------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF8
+------------------------------------------------------------------------PhysicalProject
+--------------------------------------------------------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF8
+------------------------------------------------------PhysicalProject
+--------------------------------------------------------PhysicalOlapScan[household_demographics(hd1)] apply RFs: RF5
+--------------------------------------------------PhysicalProject
+----------------------------------------------------PhysicalOlapScan[income_band(ib1)]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[store]
+------------------------------------------PhysicalProject
+--------------------------------------------PhysicalOlapScan[promotion]
+--------------------------------------PhysicalProject
+----------------------------------------filter((item.i_current_price <= 33.00) and (item.i_current_price >= 24.00) and i_color IN ('blanched', 'brown', 'burlywood', 'chocolate', 'drab', 'medium'))
+------------------------------------------PhysicalOlapScan[item]
--------------------PhysicalProject
-----------------------PhysicalOlapScan[income_band(ib2)]
+----------------------PhysicalOlapScan[date_dim(d2)]
----------------PhysicalProject
-------------------filter((item.i_current_price <= 33.00) and (item.i_current_price >= 24.00) and i_color IN ('blanched', 'brown', 'burlywood', 'chocolate', 'drab', 'medium'))
---------------------PhysicalOlapScan[item]
+------------------PhysicalOlapScan[date_dim(d3)]
--PhysicalResultSink
----PhysicalQuickSort[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query14.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query14.out
index 81cae62c393..19bdbc88c3a 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query14.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query14.out
@@ -82,18 +82,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF12 i_item_sk->[ss_item_sk,ss_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF11 ss_item_sk->[ss_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF10 d_date_sk->[ss_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10 RF11 RF12
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF12
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF12 ss_item_sk->[i_item_sk,ss_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF11 d_date_sk->[ss_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF10 i_item_sk->[ss_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10 RF11 RF12
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF12
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -104,18 +108,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF15 i_item_sk->[cs_item_sk,ss_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF14 ss_item_sk->[cs_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF13 d_date_sk->[cs_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF13 RF14 RF15
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF15
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF15 ss_item_sk->[cs_item_sk,i_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF14 d_date_sk->[cs_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF13 i_item_sk->[cs_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF13 RF14 RF15
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF15
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -126,18 +134,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF18 i_item_sk->[ss_item_sk,ws_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF17 ss_item_sk->[ws_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF16 d_date_sk->[ws_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16 RF17 RF18
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF18
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF18 ss_item_sk->[i_item_sk,ws_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF17 d_date_sk->[ws_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF16 i_item_sk->[ws_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16 RF17 RF18
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF18
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query2.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query2.out
index 197d38b7c71..e9bce4b8168 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query2.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query2.out
@@ -8,12 +8,16 @@ PhysicalCteAnchor ( cteId=CTEId#1 )
----------PhysicalProject
------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = wscs.sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[cs_sold_date_sk,ws_sold_date_sk]
--------------PhysicalUnion
-----------------PhysicalDistribute[DistributionSpecExecutionAny]
-------------------PhysicalProject
---------------------PhysicalOlapScan[web_sales] apply RFs: RF0
-----------------PhysicalDistribute[DistributionSpecExecutionAny]
-------------------PhysicalProject
---------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0
+----------------hashAgg[GLOBAL]
+------------------PhysicalDistribute[DistributionSpecHash]
+--------------------hashAgg[LOCAL]
+----------------------PhysicalProject
+------------------------PhysicalOlapScan[web_sales] apply RFs: RF0
+----------------hashAgg[GLOBAL]
+------------------PhysicalDistribute[DistributionSpecHash]
+--------------------hashAgg[LOCAL]
+----------------------PhysicalProject
+------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0
--------------PhysicalProject
----------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query31.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query31.out
index f4922710b5c..4bbfc877903 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query31.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query31.out
@@ -9,9 +9,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------PhysicalProject
--------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk]
----------------PhysicalProject
-------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
--------------------PhysicalProject
----------------------filter((ss.d_year = 1999) and d_qoy IN (1, 2, 3))
------------------------PhysicalOlapScan[date_dim]
@@ -26,9 +29,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------PhysicalProject
----------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[ws_bill_addr_sk]
------------------PhysicalProject
---------------------hashJoin[INNER_JOIN broadcast] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
+--------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
+----------------------hashAgg[GLOBAL]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
----------------------PhysicalProject
------------------------filter((ws.d_year = 1999) and d_qoy IN (1, 2, 3))
--------------------------PhysicalOlapScan[date_dim]
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query42.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query42.out
index a150f3bf0bf..db30fd50e74 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query42.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query42.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 1))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query43.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query43.out
index f92452269bc..3e470a62065 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query43.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query43.out
@@ -10,9 +10,12 @@ PhysicalResultSink
--------------PhysicalProject
----------------hashJoin[INNER_JOIN broadcast] hashCondition=((store.s_store_sk = store_sales.ss_store_sk)) otherCondition=() build RFs:RF1 s_store_sk->[ss_store_sk]
------------------PhysicalProject
---------------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+--------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+----------------------hashAgg[GLOBAL]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
----------------------PhysicalProject
------------------------filter((date_dim.d_year = 2000))
--------------------------PhysicalOlapScan[date_dim]
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query52.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query52.out
index 229d035db52..be5a368feaf 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query52.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query52.out
@@ -11,9 +11,12 @@ PhysicalResultSink
----------------PhysicalProject
------------------hashJoin[INNER_JOIN broadcast] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------------hashAgg[GLOBAL]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------hashAgg[LOCAL]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalProject
--------------------------filter((item.i_manager_id = 1))
----------------------------PhysicalOlapScan[item]
diff --git a/regression-test/data/shape_check/tpcds_sf1000/hint/query59.out b/regression-test/data/shape_check/tpcds_sf1000/hint/query59.out
index 3f740535c8b..3f87d620090 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/hint/query59.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/hint/query59.out
@@ -6,9 +6,12 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
-------------hashJoin[INNER_JOIN broadcast] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
---------------PhysicalProject
-----------------PhysicalOlapScan[store_sales] apply RFs: RF0
+------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+--------------hashAgg[GLOBAL]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------hashAgg[LOCAL]
+--------------------PhysicalProject
+----------------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------PhysicalProject
----------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
diff --git a/regression-test/data/shape_check/tpcds_sf1000/shape/query14.out b/regression-test/data/shape_check/tpcds_sf1000/shape/query14.out
index a69d5958d67..f64ea0c891c 100644
--- a/regression-test/data/shape_check/tpcds_sf1000/shape/query14.out
+++ b/regression-test/data/shape_check/tpcds_sf1000/shape/query14.out
@@ -82,18 +82,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF12 i_item_sk->[ss_item_sk,ss_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF11 ss_item_sk->[ss_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF10 d_date_sk->[ss_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10 RF11 RF12
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
-------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF12
+------------------------------hashJoin[LEFT_SEMI_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF12 ss_item_sk->[i_item_sk,ss_item_sk]
--------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[item]
+----------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF11 d_date_sk->[ss_sold_date_sk]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN bucketShuffle] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF10 i_item_sk->[ss_item_sk]
+----------------------------------------hashAgg[GLOBAL]
+------------------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------------------hashAgg[LOCAL]
+----------------------------------------------PhysicalProject
+------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF10 RF11 RF12
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[item] apply RFs: RF12
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
+----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalAssertNumRows
----------------------PhysicalDistribute[DistributionSpecGather]
------------------------PhysicalCteConsumer ( cteId=CTEId#1 )
@@ -104,18 +108,22 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF15 i_item_sk->[cs_item_sk,ss_item_sk]
---------------------------------hashJoin[LEFT_SEMI_JOIN broadcast] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF14 ss_item_sk->[cs_item_sk]
-----------------------------------PhysicalProject
-------------------------------------hashJoin[INNER_JOIN broadcast] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF13 d_date_sk->[cs_sold_date_sk]
---------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF13 RF14 RF15
---------------------------------------PhysicalProject
-----------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001))
... 33391 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org