dongjoon-hyun commented on a change in pull request #25948: 
[SPARK-29275][SQL][DOC] Describe special date/timestamp values in the SQL 
migration guide
URL: https://github.com/apache/spark/pull/25948#discussion_r329153812
 
 

 ##########
 File path: docs/sql-migration-guide.md
 ##########
 @@ -201,6 +201,20 @@ license: |
         </tr>
     </table>
 
+  - Since Spark 3.0, special values are supported in conversion from strings 
to dates and timestamps. Those values are simply notational shorthands that 
will be converted to ordinary date or timestamp values when read. The following 
string values are supported for dates:
+    - `epoch [zoneId]` - 1970-01-01
+    - `today [zoneId]` - the current date in the time zone specified by 
`spark.sql.session.timeZone`.
+    - `yesterday [zoneId]` - the current date - 1
+    - `tomorrow [zoneId]` - the current date + 1
+    - `now` - the date of running the current query. It has the same notion as 
today.
+  For example `SELECT date 'tomorrow' - date 'yesterday';` should output `2`. 
Here are special timestamp values:
+    - `epoch [zoneId]` - 1970-01-01 00:00:00+00 (Unix system time zero)
+    - `today [zoneId]` - midnight today.
 
 Review comment:
   Shall we remove the `.` at the end?

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