File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
antlr4/org/apache/spark/sql/catalyst/parser
scala/org/apache/spark/sql/catalyst/parser Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ grammar SqlBase;
4646 }
4747
4848 /* *
49- * When true, use ANSI SQL standard keywords .
49+ * When true, the behavior of keywords follows ANSI SQL standard.
5050 */
5151 public boolean SQL_standard_keyword_behavior = false;
5252}
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ abstract class AbstractSqlParser(conf: SQLConf) extends ParserInterface with Log
9191
9292 // When we use PostgreSQL dialect or use Spark dialect with setting
9393 // `spark.sql.dialect.spark.ansi.enabled=true`, the parser will use ANSI SQL standard keywords.
94- val useSQLStandardKeywords = conf.dialect match {
94+ val SQLStandardKeywordBehavior = conf.dialect match {
9595 case Dialect .POSTGRESQL => true
9696 case Dialect .SPARK => conf.dialectSparkAnsiEnabled
9797 }
@@ -100,15 +100,15 @@ abstract class AbstractSqlParser(conf: SQLConf) extends ParserInterface with Log
100100 lexer.removeErrorListeners()
101101 lexer.addErrorListener(ParseErrorListener )
102102 lexer.legacy_setops_precedence_enbled = conf.setOpsPrecedenceEnforced
103- lexer.SQL_standard_keyword_behavior = useSQLStandardKeywords
103+ lexer.SQL_standard_keyword_behavior = SQLStandardKeywordBehavior
104104
105105 val tokenStream = new CommonTokenStream (lexer)
106106 val parser = new SqlBaseParser (tokenStream)
107107 parser.addParseListener(PostProcessor )
108108 parser.removeErrorListeners()
109109 parser.addErrorListener(ParseErrorListener )
110110 parser.legacy_setops_precedence_enbled = conf.setOpsPrecedenceEnforced
111- parser.SQL_standard_keyword_behavior = useSQLStandardKeywords
111+ parser.SQL_standard_keyword_behavior = SQLStandardKeywordBehavior
112112
113113 try {
114114 try {
You can’t perform that action at this time.
0 commit comments