You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Juliusz Sompolski (Jira)" <ji...@apache.org> on 2020/05/28 19:09:00 UTC

[jira] [Created] (SPARK-31861) Thriftserver collecting timestamp not using spark.sql.session.timeZone

Juliusz Sompolski created SPARK-31861:
-----------------------------------------

             Summary: Thriftserver collecting timestamp not using spark.sql.session.timeZone
                 Key: SPARK-31861
                 URL: https://issues.apache.org/jira/browse/SPARK-31861
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Juliusz Sompolski


If JDBC client is in TimeZone PST, and sets spark.sql.session.timeZone to PST, and sends a query "SELECT timestamp '2020-05-20 12:00:00'", and the JVM timezone of the Spark cluster is e.g. CET, then
- the timestamp literal in the query is interpreted as 12:00:00 PST, i.e. 21:00:00 CET
- but currently when it's returned, the timestamps are collected from the query with a collect() in https://github.com/apache/spark/blob/master/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala#L299, and then in the end Timestamps are turned into strings using a t.toString() in https://github.com/apache/spark/blob/master/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnValue.java#L138 This will use the Spark cluster TimeZone. That results in "21:00:00" returned to the JDBC application.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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