[fix](Nereids): fix NPE InferPredicates (#29978)
PredicatePropagation shouldn't add null into List.
This commit is contained in:
@ -122,8 +122,8 @@ public class InferPredicates extends DefaultPlanRewriter<JobContext> implements
|
||||
|
||||
private Plan inferNewPredicate(Plan plan, Set<Expression> expressions) {
|
||||
Set<Expression> predicates = expressions.stream()
|
||||
.filter(c -> !c.getInputSlots().isEmpty() && plan.getOutputSet().containsAll(
|
||||
c.getInputSlots())).collect(Collectors.toSet());
|
||||
.filter(c -> !c.getInputSlots().isEmpty() && plan.getOutputSet().containsAll(c.getInputSlots()))
|
||||
.collect(Collectors.toSet());
|
||||
predicates.removeAll(plan.accept(pollUpPredicates, null));
|
||||
return PlanUtils.filterOrSelf(predicates, plan);
|
||||
}
|
||||
|
||||
@ -95,7 +95,10 @@ public class PredicatePropagation {
|
||||
slotPredicates.forEach((left, exprs) -> {
|
||||
for (Slot right : equalSet.calEqualSet(left)) {
|
||||
for (Expression expr : exprs) {
|
||||
inferred.add(doInferPredicate(left, right, expr));
|
||||
Expression inferPredicate = doInferPredicate(left, right, expr);
|
||||
if (inferPredicate != null) {
|
||||
inferred.add(inferPredicate);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user