cloud-fan commented on a change in pull request #26584: [SPARK-29951][SQL] Make
the behavior of Postgre dialect independent of ansi mode config
URL: https://github.com/apache/spark/pull/26584#discussion_r348300816
##########
File path:
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
##########
@@ -788,7 +788,7 @@ booleanValue
interval
: negativeSign=MINUS? INTERVAL (errorCapturingMultiUnitsInterval |
errorCapturingUnitToUnitInterval)?
- | {ansi}? (errorCapturingMultiUnitsInterval |
errorCapturingUnitToUnitInterval)
+ | {use_SQL_standard_keywords}? (errorCapturingMultiUnitsInterval |
errorCapturingUnitToUnitInterval)
Review comment:
I checked SQL standard:
```
<interval literal> ::=
INTERVAL [ <sign> ] <interval string> <interval qualifier>
<interval string> ::=
<quote> <unquoted interval string> <quote>
```
Spark SQL doesn't follow it completely as we allow `interval 1 year 2 days`,
but `INTERVAL` should be required under ansi mode.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]