pan3793 commented on code in PR #40823:
URL: https://github.com/apache/spark/pull/40823#discussion_r1168786863


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParseDriver.scala:
##########
@@ -127,7 +127,7 @@ abstract class AbstractSqlParser extends ParserInterface 
with SQLConfHelper with
         toResult(parser)
       }
       catch {
-        case e: ParseCancellationException =>
+        case _: ParseCancellationException | _: ParseException =>

Review Comment:
   This fix looks too broad.
   
   Have done some investigations, the key point should be to use 
`BailErrorStrategy`.
   
   This should be a long-standing issue, before SPARK-38385, Spark uses 
`DefaultErrorStrategy`, and after SPARK-38385 Spark uses `class 
SparkParserErrorStrategy() extends DefaultErrorStrategy`.
   
   So this is not the correct implementation of the "two-stage parsing 
strategy" 
   
   https://github.com/antlr/antlr4/issues/192#issuecomment-15238595
   



-- 
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]

Reply via email to