LuciferYang commented on code in PR #58225:
URL: https://github.com/apache/spark/pull/58225#discussion_r3939226540
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala:
##########
@@ -282,6 +282,13 @@ class ExpressionParserSuite extends AnalysisTest {
assertEqual("a is not distinct from b", $"a" <=> $"b")
}
+ test("invalid semi-structured extract path") {
+ checkError(
+ exception = parseException("c:['']"),
+ condition = "PARSE_SYNTAX_ERROR",
+ parameters = Map("error" -> "'[''']'", "hint" -> ""))
Review Comment:
856cc118 fixes one of the two mismatches, but the test still fails on the
new head's CI: the full old-CI failure reads `checkError found 2 mismatch(es)`,
and the second one, `queryContext.length: expected 0 but got 1`, is still
there. The ParseException carries one SQL QueryContext by default (fragment
`c:['']`, 0 to 5), while this checkError passes no queryContext, so it compares
against an empty array and the lengths can never match.
Adding `queryContext = Array(ExpectedContext("c:['']", 0, 5))` to the
checkError call makes it pass. My earlier comment only looked at the parameters
line and missed this one, sorry about that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]