Github user ueshin commented on the issue:

    https://github.com/apache/spark/pull/16781
  
    I checked HIVE-12767 and reviewed this pr roughly.
    And I collected my thoughts about the desired behavior of this issue, 
please correct me if I'm wrong.
    
    when creating table:
    
    - if `SQLConf.PARQUET_TABLE_INCLUDE_TIMEZONE` == true
      - if a property `PARQUET_TIMEZONE_TABLE_PROPERTY` exists
        - include the table property `PARQUET_TIMEZONE_TABLE_PROPERTY`
        - use the `PARQUET_TIMEZONE_TABLE_PROPERTY` value
      - else
        - include the table property `PARQUET_TIMEZONE_TABLE_PROPERTY`
        - use session local timezone as the default 
`PARQUET_TIMEZONE_TABLE_PROPERTY` value
    - else
      - if a property `PARQUET_TIMEZONE_TABLE_PROPERTY` exists
        - include the table property `PARQUET_TIMEZONE_TABLE_PROPERTY`
        - use the `PARQUET_TIMEZONE_TABLE_PROPERTY` value
      - else
        - don't include table property `PARQUET_TIMEZONE_TABLE_PROPERTY`
    
    when writing/reading data:
    
    - if a table property `PARQUET_TIMEZONE_TABLE_PROPERTY` exists
      - use the `PARQUET_TIMEZONE_TABLE_PROPERTY` value to adjust timezone
    - else
      - don't adjust timezone
    
    Timezone related expressions respect session local timezone now, so we 
should also use session local timezone as the default value of 
`PARQUET_TIMEZONE_TABLE_PROPERTY` instead of system timezone, i.e. use 
`sparkSession.sessionState.conf.sessionLocalTimeZone` instead of 
`TimeZone.getDefault()`.



---
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