-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-26215][SQL][FOLLOW-UP][MINOR] Fix the warning from ANTR4 #23897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,11 +78,11 @@ singleTableSchema | |
statement | ||
: query #statementDefault | ||
| USE db=identifier #use | ||
| CREATE DATABASE (IF NOT EXISTS)? identifier | ||
| CREATE database (IF NOT EXISTS)? identifier | ||
(COMMENT comment=STRING)? locationSpec? | ||
(WITH DBPROPERTIES tablePropertyList)? #createDatabase | ||
| ALTER DATABASE identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties | ||
| DROP DATABASE (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase | ||
| ALTER database identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties | ||
| DROP database (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase | ||
| createTableHeader ('(' colTypeList ')')? tableProvider | ||
((OPTIONS options=tablePropertyList) | | ||
(PARTITIONED BY partitionColumnNames=identifierList) | | ||
|
@@ -163,7 +163,7 @@ statement | |
(LIKE? (qualifiedName | pattern=STRING))? #showFunctions | ||
| SHOW CREATE TABLE tableIdentifier #showCreateTable | ||
| (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction | ||
| (DESC | DESCRIBE) DATABASE EXTENDED? identifier #describeDatabase | ||
| (DESC | DESCRIBE) database EXTENDED? identifier #describeDatabase | ||
| (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? | ||
tableIdentifier partitionSpec? describeColName? #describeTable | ||
| REFRESH TABLE tableIdentifier #refreshTable | ||
|
@@ -274,6 +274,11 @@ partitionVal | |
: identifier (EQ constant)? | ||
; | ||
|
||
database | ||
: DATABASE | ||
| SCHEMA | ||
; | ||
|
||
describeFuncName | ||
: qualifiedName | ||
| STRING | ||
|
@@ -750,7 +755,7 @@ number | |
| MINUS? BIGDECIMAL_LITERAL #bigDecimalLiteral | ||
; | ||
|
||
// NOTE: You must follow a rule below when you add a new ANTLR taken in this file: | ||
// NOTE: You must follow a rule below when you add a new ANTLR token in this file: | ||
// - All the ANTLR tokens = UNION(`ansiReserved`, `ansiNonReserved`) = UNION(`defaultReserved`, `nonReserved`) | ||
// | ||
// Let's say you add a new token `NEWTOKEN` and this is not reserved regardless of a `spark.sql.parser.ansi.enabled` | ||
|
@@ -1014,7 +1019,8 @@ SORTED: 'SORTED'; | |
PURGE: 'PURGE'; | ||
INPUTFORMAT: 'INPUTFORMAT'; | ||
OUTPUTFORMAT: 'OUTPUTFORMAT'; | ||
DATABASE: 'DATABASE' | 'SCHEMA'; | ||
SCHEMA: 'SCHEMA'; | ||
DATABASE: 'DATABASE'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously, token Won't this change drop support of commands like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @viirya Thanks a lot. Actually i hadn't run the tests locally for this fix and relied on jenkins. Lets me see what to do here.. thanks again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have a test to capture this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gatorsmile Its a compile time warning. Is it possible to test this ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gatorsmile Hi Sean, i found out, one of the way we can get this checked is by failing the build on a warning. I tried using https://www.antlr.org/api/maven-plugin/latest/antlr4-mojo.html Here is the error when i used this option.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dilipbiswal if it's just for the antlr plugin, yes that's a good idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srowen Yeah.. its for the antlr plugin. Thank you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
DATABASES: 'DATABASES' | 'SCHEMAS'; | ||
DFS: 'DFS'; | ||
TRUNCATE: 'TRUNCATE'; | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the keyword
database
change todatabaseTag
and reduce confuse?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beliefer I think database in lower case indicates a parser rule and different from database in upper case which is a lexer rule. We already have a precedence in our grammar file for "identifier". IMHO keeping it as database reads better.