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


   ### What changes were proposed in this pull request?
   Add new constructor to the `ConvertTimezone` expression (see 
https://github.com/apache/spark/pull/34817) which accepts only 2 arguments:
   1. `<targetTz>` - the time zone to which the input timestamp should be 
converted.
   2. `<sourceTs>` - the timestamp to convert.
   
   and sets `<sourceTz>` to the current session time zone (see the SQL config 
`spark.sql.session.timeZone`).
    
   ### Why are the changes needed?
   To help users in migrations from other systems to Spark SQL. Other systems 
support optional first parameter:
   - https://docs.aws.amazon.com/redshift/latest/dg/CONVERT_TIMEZONE.html
   - https://docs.snowflake.com/en/sql-reference/functions/convert_timezone.html
   
   ### Does this PR introduce _any_ user-facing change?
   No, it extends the existing signature, and the function hasn't been released 
yet.
   
   ### How was this patch tested?
   By running new tests:
   ```
   $ build/sbt "sql/test:testOnly 
org.apache.spark.sql.expressions.ExpressionInfoSuite" 
   $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z 
timestamp-ltz.sql"
   $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z 
timestamp-ntz.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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to