-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32251][SQL][DOCS][TESTS] Fix SQL keyword document #29055
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
Conversation
maropu
left a comment
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.
Cool, thanks for the updates! LGTM except for the minor comment.
| |DISTINCT|reserved|non-reserved|reserved| | ||
| |DISTRIBUTE|non-reserved|non-reserved|non-reserved| | ||
| |DIV|non-reserved|non-reserved|non-reserved| | ||
| |DIV|non-reserved|non-reserved|not a keyword| |
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.
Ah, I see. We cannot remove this line: non-reserved|non-reserved|not a keyword? I think users don't need to care about the words.
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.
But is DIV a keyword?
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.
DIV is a non-reserved keyword in Apache Spark. I guess we need to have this here.
|
Test build #125480 has finished for PR 29055 at commit
|
|
Retest this please. |
|
Thank you for pinging me, @cloud-fan ! |
|
Test build #125489 has started for PR 29055 at commit |
|
Retest this please |
| } | ||
| } | ||
| // DIV is an operator but is also a keyword | ||
| keywords + "DIV" |
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.
@cloud-fan . Instead of adding exceptions here and line 136, can we switch the original lines in SqlBase.g4? I guess you can move DIV: 'DIV'; into somewhere before //--SPARK-KEYWORD-LIST-END. WDYT?
//--SPARK-KEYWORD-LIST-END
//============================
// End of the keywords list
//============================
EQ : '=' | '==';
NSEQ: '<=>';
NEQ : '<>';
NEQJ: '!=';
LT : '<';
LTE : '<=' | '!>';
GT : '>';
GTE : '>=' | '!<';
PLUS: '+';
MINUS: '-';
ASTERISK: '*';
SLASH: '/';
PERCENT: '%';
DIV: 'DIV';
|
Test build #125514 has finished for PR 29055 at commit
|
|
retest this please |
|
Test build #125559 has finished for PR 29055 at commit
|
|
Test build #125557 has finished for PR 29055 at commit
|
| Below is a list of all the keywords in Spark SQL. | ||
|
|
||
| |Keyword|Spark SQL<br/>ANSI Mode|Spark SQL<br/>Default Mode|SQL-2011| | ||
| |Keyword|Spark SQL<br/>ANSI Mode|Spark SQL<br/>Default Mode|SQL-2016| |
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.
Is there any consensus to decide which version of ANSI SQL standard that we actually try to comply with?
Or any protocol to define the compatibility between Spark versions and ANSI SQL standards?
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.
I think the latest ANSI SQL standard is preferred.
Also to note that: ANSI compliant doesn't mean to follow everything in ANSI SQL. e.g. a keyword reserved in ANSI SQL can be non-reserved in Spark.
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.
Looking at the history of this standard, the trend of it seems to add more and more keywords and change the non-reserved to reserved. I guess it's ok to follow the latest one here as literally we will add migration guide for every newly added keyword.
|
Retest this please |
dongjoon-hyun
left a comment
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.
+1, LGTM. Thank you, @cloud-fan .
|
Merged to master/3.0 because all Scala/Java UT passed in the current run. PySpark and SparkR UT is irrelevant to this PR. |
### What changes were proposed in this pull request? This PR improves the test to make sure all the SQL keywords are documented correctly. It fixes several issues: 1. some keywords are not documented 2. some keywords are not ANSI SQL keywords but documented as reserved/non-reserved. ### Why are the changes needed? To make sure the implementation matches the doc. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? new test Closes #29055 from cloud-fan/keyword. Authored-by: Wenchen Fan <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 84db660) Signed-off-by: Dongjoon Hyun <[email protected]>
|
Test build #125622 has finished for PR 29055 at commit
|
What changes were proposed in this pull request?
This PR improves the test to make sure all the SQL keywords are documented correctly. It fixes several issues:
Why are the changes needed?
To make sure the implementation matches the doc.
Does this PR introduce any user-facing change?
No
How was this patch tested?
new test