Skip to content

Commit

Permalink
[fix](nereids)move RecomputeLogicalPropertiesProcessor rule before to…
Browse files Browse the repository at this point in the history
…pn optimization (apache#22488)

topn optimization will change MutableState. So need move RecomputeLogicalPropertiesProcessor rule before it
  • Loading branch information
starocean999 authored Aug 2, 2023
1 parent a4ef340 commit 527782f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public List<PlanPostProcessor> getProcessors() {
}
}
builder.add(new Validator());
builder.add(new RecomputeLogicalPropertiesProcessor());
builder.add(new TopNScanOpt());
builder.add(new TwoPhaseReadOpt());
builder.add(new RecomputeLogicalPropertiesProcessor());
return builder.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testUseTopNRf() {
.rewrite()
.implement();
PhysicalPlan plan = checker.getPhysicalPlan();
new PlanPostProcessors(checker.getCascadesContext()).process(plan);
plan = new PlanPostProcessors(checker.getCascadesContext()).process(plan);
Assertions.assertTrue(plan.children().get(0).child(0) instanceof PhysicalTopN);
PhysicalTopN localTopN = (PhysicalTopN) plan.children().get(0).child(0);
Assertions.assertTrue(localTopN.getMutableState(PhysicalTopN.TOPN_RUNTIME_FILTER).isPresent());
Expand All @@ -53,7 +53,7 @@ public void testNotUseTopNRf() {
.rewrite()
.implement();
PhysicalPlan plan = checker.getPhysicalPlan();
new PlanPostProcessors(checker.getCascadesContext()).process(plan);
plan = new PlanPostProcessors(checker.getCascadesContext()).process(plan);
Assertions.assertTrue(plan.children().get(0) instanceof PhysicalTopN);
PhysicalTopN localTopN = (PhysicalTopN) plan.children().get(0);
Assertions.assertFalse(localTopN.getMutableState(PhysicalTopN.TOPN_RUNTIME_FILTER).isPresent());
Expand Down

0 comments on commit 527782f

Please sign in to comment.