Github user ueshin commented on the issue:

    https://github.com/apache/spark/pull/16781
  
    @squito I'm sorry for late reply.
    I was reviewing this pr again and current Hive behavior deeply.
    
    It seems the both behaviors are the same when the table property exists, 
but this is a little complicated, so I want to confirm if the following 
behavior is correct or not by the simple example:
    
    ```scala
    
    scala> spark.conf.set("spark.sql.session.timeZone", "JST")
    
    scala> sql("create table foo (display string, ts timestamp) stored as 
parquet tblproperties (parquet.mr.int96.write.zone='JST')")
    scala> sql("insert into foo values ('2017-01-01 00:00:00', cast('2017-01-01 
00:00:00' as timestamp))")
    
    scala> sql("select * from foo").show(truncate = false)
    +-------------------+-------------------+
    |display            |ts                 |
    +-------------------+-------------------+
    |2017-01-01 00:00:00|2017-01-01 00:00:00|
    +-------------------+-------------------+
    
    
    scala> sql("create table bar (display string, ts timestamp) stored as 
parquet")
    scala> sql("insert into bar values ('2017-01-01 00:00:00', cast('2017-01-01 
00:00:00' as timestamp))")
    
    scala> sql("select * from bar").show(truncate = false)
    +-------------------+-------------------+
    |display            |ts                 |
    +-------------------+-------------------+
    |2017-01-01 00:00:00|2017-01-01 00:00:00|
    +-------------------+-------------------+
    
    
    scala> spark.conf.set("spark.sql.session.timeZone", "PST")
    
    
    // ts is adjusted from JST to PST.
    scala> sql("select * from foo").show(truncate = false)
    +-------------------+-------------------+
    |display            |ts                 |
    +-------------------+-------------------+
    |2017-01-01 00:00:00|2017-01-01 00:00:00|
    +-------------------+-------------------+
    
    
    // ts isn't adjusted.
    scala> sql("select * from bar").show(truncate = false)
    +-------------------+-------------------+
    |display            |ts                 |
    +-------------------+-------------------+
    |2017-01-01 00:00:00|2016-12-31 07:00:00|
    +-------------------+-------------------+
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to