Maxim Gekk created SPARK-27252:
----------------------------------

             Summary: Make current_date() independent from time zones
                 Key: SPARK-27252
                 URL: https://issues.apache.org/jira/browse/SPARK-27252
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 2.4.0
            Reporter: Maxim Gekk


The CurrentDate expression produces a result of DateType which is by definition 
number of days since epoch (in UTC time zone). Current implementation shifts 
the number of days according to session time zone `spark.sql.session.timeZone`. 
Result of shifting cannot be considered as number of days since epoch in UTC 
time zone, and cannot have type `DateType`. There are many reasons that makes 
the result invalid. For example:
# zone offset depends on an instant in UTC timezone, and zone offset of 
`spark.sql.session.timeZone` in shifted date may have different value.
# Result of shifting cannot be considered as number of days since epoch anymore.

The ticket aims to make `current_date` independent from time zone, and to 
return the current date in UTC time zone.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to