Skip to content

Commit

Permalink
Static import Join types
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiafi authored and martint committed Sep 16, 2019
1 parent dd45619 commit 1cfd844
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
import static io.prestosql.sql.analyzer.SemanticExceptions.notSupportedException;
import static io.prestosql.sql.planner.plan.AggregationNode.singleGroupingSet;
import static io.prestosql.sql.tree.BooleanLiteral.TRUE_LITERAL;
import static io.prestosql.sql.tree.Join.Type.CROSS;
import static io.prestosql.sql.tree.Join.Type.IMPLICIT;
import static io.prestosql.sql.tree.Join.Type.INNER;
import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -218,7 +220,7 @@ protected RelationPlan visitJoin(Join node, Void context)

Optional<Unnest> unnest = getUnnest(node.getRight());
if (unnest.isPresent()) {
if (node.getType() != Join.Type.CROSS && node.getType() != Join.Type.IMPLICIT) {
if (node.getType() != CROSS && node.getType() != IMPLICIT) {
throw notSupportedException(unnest.get(), "UNNEST on other than the right side of CROSS JOIN");
}
return planCrossJoinUnnest(leftPlan, node, unnest.get());
Expand Down Expand Up @@ -248,7 +250,7 @@ protected RelationPlan visitJoin(Join node, Void context)
List<Expression> complexJoinExpressions = new ArrayList<>();
List<Expression> postInnerJoinConditions = new ArrayList<>();

if (node.getType() != Join.Type.CROSS && node.getType() != Join.Type.IMPLICIT) {
if (node.getType() != CROSS && node.getType() != IMPLICIT) {
Expression criteria = analysis.getJoinCriteria(node);

RelationType left = analysis.getOutputDescriptor(node.getLeft());
Expand Down

0 comments on commit 1cfd844

Please sign in to comment.