Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-stec authored and sopel39 committed May 27, 2022
1 parent 24442b0 commit 111c917
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ private PlanNode pushPartialToRightChild(AggregationNode node, JoinNode child, C
private Set<Symbol> getJoinRequiredSymbols(JoinNode node)
{
return Streams.concat(
node.getCriteria().stream().map(JoinNode.EquiJoinClause::getLeft),
node.getCriteria().stream().map(JoinNode.EquiJoinClause::getRight),
node.getFilter().map(SymbolsExtractor::extractUnique).orElse(ImmutableSet.of()).stream(),
node.getLeftHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of()).stream(),
node.getRightHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of()).stream())
node.getCriteria().stream().map(JoinNode.EquiJoinClause::getLeft),
node.getCriteria().stream().map(JoinNode.EquiJoinClause::getRight),
node.getFilter().map(SymbolsExtractor::extractUnique).orElse(ImmutableSet.of()).stream(),
node.getLeftHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of()).stream(),
node.getRightHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of()).stream())
.collect(toImmutableSet());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,33 +612,33 @@ private DynamicFiltersResult createDynamicFilters(
}

List<DynamicFilterExpression> clauses = Streams.concat(
equiJoinClauses
.stream()
.map(clause -> new DynamicFilterExpression(
new ComparisonExpression(EQUAL, clause.getLeft().toSymbolReference(), clause.getRight().toSymbolReference()))),
joinFilterClauses.stream()
.flatMap(Rewriter::tryConvertBetweenIntoComparisons)
.filter(clause -> joinDynamicFilteringExpression(clause, node.getLeft().getOutputSymbols(), node.getRight().getOutputSymbols()))
.map(expression -> {
if (expression instanceof NotExpression) {
NotExpression notExpression = ((NotExpression) expression);
ComparisonExpression comparison = (ComparisonExpression) notExpression.getValue();
return new DynamicFilterExpression(new ComparisonExpression(EQUAL, comparison.getLeft(), comparison.getRight()), true);
}
return new DynamicFilterExpression((ComparisonExpression) expression);
})
.map(expression -> {
ComparisonExpression comparison = expression.getComparison();
Expression leftExpression = comparison.getLeft();
Expression rightExpression = comparison.getRight();
boolean alignedComparison = node.getLeft().getOutputSymbols().containsAll(extractUnique(leftExpression));
return new DynamicFilterExpression(
new ComparisonExpression(
alignedComparison ? comparison.getOperator() : comparison.getOperator().flip(),
alignedComparison ? leftExpression : rightExpression,
alignedComparison ? rightExpression : leftExpression),
expression.isNullAllowed());
}))
equiJoinClauses
.stream()
.map(clause -> new DynamicFilterExpression(
new ComparisonExpression(EQUAL, clause.getLeft().toSymbolReference(), clause.getRight().toSymbolReference()))),
joinFilterClauses.stream()
.flatMap(Rewriter::tryConvertBetweenIntoComparisons)
.filter(clause -> joinDynamicFilteringExpression(clause, node.getLeft().getOutputSymbols(), node.getRight().getOutputSymbols()))
.map(expression -> {
if (expression instanceof NotExpression) {
NotExpression notExpression = ((NotExpression) expression);
ComparisonExpression comparison = (ComparisonExpression) notExpression.getValue();
return new DynamicFilterExpression(new ComparisonExpression(EQUAL, comparison.getLeft(), comparison.getRight()), true);
}
return new DynamicFilterExpression((ComparisonExpression) expression);
})
.map(expression -> {
ComparisonExpression comparison = expression.getComparison();
Expression leftExpression = comparison.getLeft();
Expression rightExpression = comparison.getRight();
boolean alignedComparison = node.getLeft().getOutputSymbols().containsAll(extractUnique(leftExpression));
return new DynamicFilterExpression(
new ComparisonExpression(
alignedComparison ? comparison.getOperator() : comparison.getOperator().flip(),
alignedComparison ? leftExpression : rightExpression,
alignedComparison ? rightExpression : leftExpression),
expression.isNullAllowed());
}))
.collect(toImmutableList());

// New equiJoinClauses could potentially not contain symbols used in current dynamic filters.
Expand Down

0 comments on commit 111c917

Please sign in to comment.