subhramit commented on PR #58225: URL: https://github.com/apache/spark/pull/58225#issuecomment-5544877896
> `AstBuilder.scala:4542` is one more instance of the same defect. `new ParseException(errorClass = "PARSE_SYNTAX_ERROR", ctx = ctx)` takes the two-arg overload (parsers.scala:200), which defaults `messageParameters` to `Map.empty`, while the template needs `<error>` and `<hint>`. The throw happens inside the constructor, so the object raised is a `SparkException`, not a `ParseException`, and none of the three catch branches in `AbstractParser.parse` match. The user gets a bare `INTERNAL_ERROR` with no SQL position instead of a syntax error. `SELECT c:[''] FROM t` reaches it: `JsonPathParser`'s `named` rule requires a non-empty name between `['` and `']`, so the path fails to parse. > > A sweep anchored on the `Map(...)` literal next to `errorClass` cannot see this one, because the line has no `Map` on it. Either add `error`/`hint` here too, or file a separate JIRA for it. Yep, had missed that one. fixed in the [latest commit](https://github.com/apache/spark/pull/58225/commits/b524b6ed0c5bcfc6b194c9d3f506350724d60151) by wiring `PARSE_SYNTAX_ERROR` with the required `error`/`hint` parameters and also added a parser regression test. And that I think addresses all your comments so far @LuciferYang -- 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]
