Skip to content

Commit

Permalink
optimize code usage
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Dec 18, 2024
1 parent 5f12cc8 commit 5c5b5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private Pair<BitSet, Long> buildForMv(Plan plan) {
return Pair.of(child.first, child.second);
}

if (StructInfo.isValidLimit(plan)) {
if (StructInfo.isValidPushedNode(plan)) {
return this.buildForMv(plan.child(0));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,10 @@ public static PlanCheckContext of(Set<JoinType> supportJoinTypes) {
}

/**
* Limit, topN or partitionTopN which is pushed down are valid
* */
public static boolean isValidLimit(Plan plan) {
* Limit, topN or partitionTopN which is pushed down doesn't participation in query rewritten by mv
* should be valid
*/
public static boolean isValidPushedNode(Plan plan) {
return plan instanceof CouldPushed && ((CouldPushed) plan).needRemain() == true
&& ((CouldPushed) plan).isPushed();
}
Expand Down Expand Up @@ -701,7 +702,7 @@ public Boolean visit(Plan plan, PlanCheckContext checkContext) {
|| plan instanceof LogicalSort
|| plan instanceof LogicalAggregate
|| plan instanceof GroupPlan
|| plan instanceof LogicalRepeat || isValidLimit(plan)) {
|| plan instanceof LogicalRepeat || isValidPushedNode(plan)) {
return doVisit(plan, checkContext);
}
return false;
Expand Down

0 comments on commit 5c5b5c6

Please sign in to comment.