Skip to content

Commit

Permalink
remove stream api
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed May 22, 2024
1 parent f1b6021 commit 509efa6
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -333,16 +334,17 @@ private LogicalProject<? extends Plan> pushDownCountWithoutSlotRef(
return canNotPush;
}
}
List<Expression> projectExpr = project.getProjects()
.stream()
.flatMap(p -> Project.collectExpressions(p).stream())
.collect(ImmutableList.toImmutableList());
boolean noSlotRef = projectExpr.stream().allMatch(expr -> {
List<Expression> projectExpr = new ArrayList<>();
for (Expression p : project.getProjects()) {
projectExpr.addAll(Project.collectExpressions(p));
}
boolean noSlotRef = true;
for (Expression expr : projectExpr) {
if (expr instanceof SlotReference) {
return false;
noSlotRef = false;
break;
}
return true;
});
}
if (!noSlotRef) {
return canNotPush;
}
Expand Down

0 comments on commit 509efa6

Please sign in to comment.