Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -130,11 +130,14 @@ object QueryParsingErrors {
}

def joinCriteriaUnimplementedError(join: JoinCriteriaContext, ctx: RelationContext): Throwable = {
new ParseException(s"Unimplemented joinCriteria: $join", ctx)
new ParseException(
errorClass = "INTERNAL_ERROR",
messageParameters = Array(s"Internal error: 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.")
}
}