Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ public PlanNode visitWindow(WindowNode node, RewriteContext<Expression> context)
// pre-projected symbols.
Predicate<Expression> isSupported = conjunct ->
isDeterministic(conjunct, metadata) &&
extractUnique(conjunct).stream()
.allMatch(partitionSymbols::contains);
partitionSymbols.containsAll(extractUnique(conjunct));

Map<Boolean, List<Expression>> conjuncts = extractConjuncts(context.get()).stream().collect(Collectors.partitioningBy(isSupported));

Expand All @@ -280,8 +279,7 @@ public PlanNode visitProject(ProjectNode node, RewriteContext<Expression> contex
.map(Map.Entry::getKey)
.collect(Collectors.toSet());

Predicate<Expression> deterministic = conjunct -> extractUnique(conjunct).stream()
.allMatch(deterministicSymbols::contains);
Predicate<Expression> deterministic = conjunct -> deterministicSymbols.containsAll(extractUnique(conjunct));

Map<Boolean, List<Expression>> conjuncts = extractConjuncts(context.get()).stream().collect(Collectors.partitioningBy(deterministic));

Expand Down Expand Up @@ -363,7 +361,7 @@ public PlanNode visitMarkDistinct(MarkDistinctNode node, RewriteContext<Expressi
{
Set<Symbol> pushDownableSymbols = ImmutableSet.copyOf(node.getDistinctSymbols());
Map<Boolean, List<Expression>> conjuncts = extractConjuncts(context.get()).stream()
.collect(Collectors.partitioningBy(conjunct -> extractUnique(conjunct).stream().allMatch(pushDownableSymbols::contains)));
.collect(Collectors.partitioningBy(conjunct -> pushDownableSymbols.containsAll(extractUnique(conjunct))));

PlanNode rewrittenNode = context.defaultRewrite(node, combineConjuncts(metadata, conjuncts.get(true)));

Expand Down Expand Up @@ -1410,7 +1408,7 @@ private PlanNode visitFilteringSemiJoin(SemiJoinNode node, RewriteContext<Expres
.filter(Objects::nonNull)
.forEach(sourceConjuncts::add);

// See if we can push the source effective predicate to the filtering soruce side
// See if we can push the source effective predicate to the filtering source side
EqualityInference.nonInferrableConjuncts(metadata, sourceEffectivePredicate)
.map(conjunct -> allInference.rewrite(conjunct, filterScope))
.filter(Objects::nonNull)
Expand Down