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

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

    [ https://issues.apache.org/jira/browse/SPARK-31861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17119141#comment-17119141 ] 

Apache Spark commented on SPARK-31861:
--------------------------------------

User 'juliuszsompolski' has created a pull request for this issue:
https://github.com/apache/spark/pull/28671

> 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
>            Priority: Major
>
> 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