cloud-fan commented on code in PR #52334:
URL: https://github.com/apache/spark/pull/52334#discussion_r2425625657
##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/parsers.scala:
##########
@@ -65,35 +65,14 @@ abstract class AbstractParser extends
DataTypeParserInterface with Logging {
val tokenStream = new CommonTokenStream(lexer)
val parser = new SqlBaseParser(tokenStream)
- if (conf.manageParserCaches) AbstractParser.installCaches(parser)
- parser.addParseListener(PostProcessor)
- parser.addParseListener(UnclosedCommentProcessor(command, tokenStream))
- parser.removeErrorListeners()
- parser.addErrorListener(ParseErrorListener)
- parser.legacy_setops_precedence_enabled = conf.setOpsPrecedenceEnforced
- parser.legacy_exponent_literal_as_decimal_enabled =
conf.exponentLiteralAsDecimalEnabled
- parser.SQL_standard_keyword_behavior = conf.enforceReservedKeywords
- parser.double_quoted_identifiers = conf.doubleQuotedIdentifiers
+
+ // Use shared parser configuration to ensure consistency.
+ AbstractParser.configureParser(parser, command, tokenStream, conf)
// https://github.com/antlr/antlr4/issues/192#issuecomment-15238595
// Save a great deal of time on correct inputs by using a two-stage
parsing strategy.
Review Comment:
shall we move this comment to the method doc of
`executeWithTwoStageStrategy`?
--
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]