You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/12 12:01:05 UTC

[GitHub] [spark] MaxGekk opened a new pull request #35826: [SPARK-38535][SQL] Add the `datetimeUnit` enum and use it in `TIMESTAMPADD/DIFF`

MaxGekk opened a new pull request #35826:
URL: https://github.com/apache/spark/pull/35826


   ### What changes were proposed in this pull request?
   In the PR, I propose to add new enum `datetimeUnit` and re-use it in the datetime "function"s `TIMESTAMPADD` (see SPARK-38195) and `TIMESTAMPDIFF` (see SPARK-38284):
   
   SqlBaseParser.g4:
   ```
   datetimeUnit
       : YEAR | QUARTER | MONTH
       | WEEK | DAY | DAYOFYEAR
       | HOUR | MINUTE | SECOND | MILLISECOND | MICROSECOND
       ;
   ```
   
   ### Why are the changes needed?
   1. The enum will allow to document the list of supported units in the grammar which should improve user experience with Spark SQL.
   2. Switching to unified parse error should improve UX too.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   By running test suites for `TIMESTAMPADD`/`TIMESTAMPDIFF`:
   ```
   $ build/sbt "test:testOnly *SQLKeywordSuite"
   $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z timestamp.sql"
   ```


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk closed pull request #35826: [SPARK-38535][SQL] Add the `datetimeUnit` enum and use it in `TIMESTAMPADD/DIFF`

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #35826:
URL: https://github.com/apache/spark/pull/35826


   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on pull request #35826: [SPARK-38535][SQL] Add the `datetimeUnit` enum and use it in `TIMESTAMPADD/DIFF`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #35826:
URL: https://github.com/apache/spark/pull/35826#issuecomment-1066550342


   Merging to master. Thank you, @cloud-fan for review.


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org