cloud-fan commented on a change in pull request #26285: [SPARK-29623][SQL] do 
not allow multiple unit TO unit statements in interval literal syntax
URL: https://github.com/apache/spark/pull/26285#discussion_r340539795
 
 

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -761,12 +761,24 @@ booleanValue
     ;
 
 interval
-    : {ansi}? INTERVAL? intervalField+
-    | {!ansi}? INTERVAL intervalField*
+    : INTERVAL (errorCapturingMultiUnitsInterval | 
errorCapturingUnitToUnitInterval)?
+    | {ansi}? (errorCapturingMultiUnitsInterval | 
errorCapturingUnitToUnitInterval)
 
 Review comment:
   `{ansi}? (errorCapturingMultiUnitsInterval | 
errorCapturingUnitToUnitInterval)?` is illegal as it can match anything. Note 
that we need to make `(errorCapturingMultiUnitsInterval | 
errorCapturingUnitToUnitInterval)` optional so that we can detect `select 
interval` and give precise error message.

----------------------------------------------------------------
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]

Reply via email to