Skip to content
Closed
Show file tree
Hide file tree
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 @@ -1146,7 +1146,7 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with SQLConfHelper with Logg
case Some(c) if c.booleanExpression != null =>
(baseJoinType, Option(expression(c.booleanExpression)))
case Some(c) =>
throw QueryParsingErrors.joinCriteriaUnimplementedError(c, ctx)
throw new IllegalStateException(s"Unimplemented joinCriteria: $c")
case None if join.NATURAL != null =>
if (join.LATERAL != null) {
throw QueryParsingErrors.lateralJoinWithNaturalJoinUnsupportedError(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,8 @@ object QueryParsingErrors {
new ParseException(s"Cannot resolve window reference '$name'", ctx)
}

def joinCriteriaUnimplementedError(join: JoinCriteriaContext, ctx: RelationContext): Throwable = {
new ParseException(s"Unimplemented joinCriteria: $join", ctx)
}

def naturalCrossJoinUnsupportedError(ctx: RelationContext): Throwable = {
new ParseException("NATURAL CROSS JOIN is not supported", ctx)
new ParseException("UNSUPPORTED_FEATURE", Array("NATURAL CROSS JOIN."), ctx)
}

def emptyInputForTableSampleError(ctx: ParserRuleContext): Throwable = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,12 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession {
message = "Invalid SQL syntax: LATERAL can only be used with subquery.")
}
}

test("UNSUPPORTED_FEATURE: NATURAL CROSS JOIN is not supported") {
validateParsingError(
sqlText = "SELECT * FROM a NATURAL CROSS JOIN b",
errorClass = "UNSUPPORTED_FEATURE",
sqlState = "0A000",
message = "The feature is not supported: NATURAL CROSS JOIN.")
}
}