Hisoka-X commented on code in PR #40823:
URL: https://github.com/apache/spark/pull/40823#discussion_r1169595889


##########
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:
   > @Hisoka-X @cloud-fan I think we should provide two `ErrorStrategy`s
   > 
   > ```
   > class SparkParserBailErrorStrategy() extends BailErrorStrategy
   > class SparkParserDefaultErrorStrategy() extends DefaultErrorStrategy
   > ```
   > 
   > and follow the [antlr/antlr4#192 
(comment)](https://github.com/antlr/antlr4/issues/192#issuecomment-15238595) to 
implement the "two-stage parsing strategy"
   
   I'm not sure this way will be worked. The main reason for custom 
`ErrorStrategy` are replace anltr4 Exception by some Spark Exception. So we 
also need catch the Spark Exception.



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