LuciferYang commented on code in PR #58225:
URL: https://github.com/apache/spark/pull/58225#discussion_r3939077392
##########
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:
The new "invalid semi-structured extract path" test expects one extra single
quote: for input `c:['']`, `''` lexes as one empty STRING_LITERAL,
`ctx.path.getText` is `['']`, so `s"'$field'"` yields `'['']'` (two inner
quotes) while the test expects `'[''']'` (three). The catalyst CI job on the
head commit already fails on exactly this test: `parameters: expected Map(error
-> '[''']', hint -> ) but got HashMap(hint -> , error -> '['']')`.
Changing the expectation to `"'['']'"` fixes it.
--
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]