MaxGekk commented on issue #25981: [SPARK-28420][SQL] Support the `INTERVAL` type in `date_part()` URL: https://github.com/apache/spark/pull/25981#issuecomment-543076206 > when extracting unit smaller than second, return a fraction of the second unit's value from the normalized date/timestamp/interval. Here are examples for units smaller than second in PostgreSQL (my implementation behaves the same): ```sql maxim=# SELECT date_part('milliseconds', interval '10 minutes 30 seconds 1 milliseconds 1 microseconds'); date_part ----------- 30001.001 (1 row) maxim=# SELECT date_part('microseconds', interval '10 minutes 30 seconds 1 milliseconds 1 microseconds'); date_part ----------- 30001001 (1 row) ``` Similar for timestamps: ```sql maxim=# SELECT date_part('milliseconds', timestamp'2019-10-17 11:12:30.001001'); date_part ----------- 30001.001 (1 row) maxim=# SELECT date_part('microseconds', timestamp'2019-10-17 11:12:30.001001'); date_part ----------- 30001001 (1 row) ```
---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org