Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](Nereids): find hash condition after infer predicate #30026

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[fix](Nereids): find hash condition after infer predicate
  • Loading branch information
jackwener committed Jan 16, 2024
commit 0bac8cc6d660b6b7fce51fffeffaa1beb80bf1d2
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public class Rewriter extends AbstractBatchJobExecutor {
// but top-down traverse can not cover this case in one iteration, so bottom-up is more
// efficient because it can find the new plans and apply transform wherever it is
bottomUp(RuleSet.PUSH_DOWN_FILTERS),
//after push down, some new filters are generated, which needs to be optimized. (example: tpch q19)
// after push down, some new filters are generated, which needs to be optimized. (example: tpch q19)
topDown(new ExpressionOptimization()),
topDown(
new MergeFilters(),
Expand Down Expand Up @@ -263,6 +263,7 @@ public class Rewriter extends AbstractBatchJobExecutor {
// after eliminate outer join, we can move some filters to join.otherJoinConjuncts,
// this can help to translate plan to backend
topDown(new PushFilterInsideJoin()),
topDown(new FindHashConditionForJoin()),
topDown(new ExpressionNormalization())
),

Expand Down
4 changes: 2 additions & 2 deletions regression-test/data/nereids_p0/hint/fix_leading.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ PhysicalResultSink
----------PhysicalDistribute[DistributionSpecHash]
------------PhysicalOlapScan[t2]
--------PhysicalDistribute[DistributionSpecHash]
----------NestedLoopJoin[CROSS_JOIN](t3.c3 = t4.c4)
----------hashJoin[INNER_JOIN] hashCondition=((t3.c3 = t4.c4)) otherCondition=()
------------PhysicalOlapScan[t3]
------------PhysicalDistribute[DistributionSpecReplicated]
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalOlapScan[t4]

Hint log:
Expand Down
16 changes: 8 additions & 8 deletions regression-test/data/nereids_p0/hint/test_leading.out
Original file line number Diff line number Diff line change
Expand Up @@ -2609,7 +2609,7 @@ PhysicalResultSink
------------PhysicalProject
--------------PhysicalOlapScan[t2]
------------PhysicalDistribute[DistributionSpecReplicated]
--------------NestedLoopJoin[CROSS_JOIN](t1.c1 = t3.c3)
--------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t3.c3)) otherCondition=()
----------------PhysicalProject
------------------PhysicalOlapScan[t1]
----------------PhysicalDistribute[DistributionSpecReplicated]
Expand All @@ -2631,7 +2631,7 @@ PhysicalResultSink
------------PhysicalProject
--------------PhysicalOlapScan[t2]
------------PhysicalDistribute[DistributionSpecReplicated]
--------------NestedLoopJoin[CROSS_JOIN](t1.c1 = t3.c3)
--------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t3.c3)) otherCondition=()
----------------PhysicalProject
------------------PhysicalOlapScan[t3]
----------------PhysicalDistribute[DistributionSpecReplicated]
Expand Down Expand Up @@ -2745,7 +2745,7 @@ PhysicalResultSink
------------PhysicalProject
--------------PhysicalOlapScan[t2]
------------PhysicalDistribute[DistributionSpecReplicated]
--------------NestedLoopJoin[CROSS_JOIN](t1.c1 = t3.c3)
--------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t3.c3)) otherCondition=()
----------------PhysicalProject
------------------PhysicalOlapScan[t1]
----------------PhysicalDistribute[DistributionSpecReplicated]
Expand All @@ -2767,7 +2767,7 @@ PhysicalResultSink
------------PhysicalProject
--------------PhysicalOlapScan[t2]
------------PhysicalDistribute[DistributionSpecReplicated]
--------------NestedLoopJoin[CROSS_JOIN](t1.c1 = t3.c3)
--------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t3.c3)) otherCondition=()
----------------PhysicalProject
------------------PhysicalOlapScan[t3]
----------------PhysicalDistribute[DistributionSpecReplicated]
Expand Down Expand Up @@ -2881,10 +2881,10 @@ PhysicalResultSink
------------PhysicalProject
--------------PhysicalOlapScan[t2]
------------PhysicalDistribute[DistributionSpecHash]
--------------NestedLoopJoin[CROSS_JOIN](t1.c1 = t3.c3)
--------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t3.c3)) otherCondition=()
----------------PhysicalProject
------------------PhysicalOlapScan[t1]
----------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[t3]

Expand All @@ -2903,10 +2903,10 @@ PhysicalResultSink
------------PhysicalProject
--------------PhysicalOlapScan[t2]
------------PhysicalDistribute[DistributionSpecHash]
--------------NestedLoopJoin[CROSS_JOIN](t1.c1 = t3.c3)
--------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = t3.c3)) otherCondition=()
----------------PhysicalProject
------------------PhysicalOlapScan[t3]
----------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[t1]

Expand Down
Loading