GitHub user squito opened a pull request:

    https://github.com/apache/spark/pull/16781

    [SPARK-12297][SQL][POC] Hive compatibility for Parquet Timestamps

    ## What changes were proposed in this pull request?
    
    Hive has very strange behavior when writing timestamps to parquet data.  It 
will always apply the conversion from the local timezone to UTC, which it then 
reverses when reading the data back.  For compatibility with Hive, Spark should 
provide an option for doing the same conversion, when necessary, based on table 
metadata.  This goes along with HIVE-12767.
    
    Note that the default for Spark remains unchanged; created tables are 
marked as UTC, which means the read and write path remains unchanged (and 
avoids slow timezone logic).  The major use case is that *legacy* tables 
written by hive can now be read in correctly by Spark, as long as the 
appropriate table properties are set.
    
    ## How was this patch tested?
    
    Added a unit test which creates tables, reads and writes data, under a 
variety of permutations (conf on whether or not to add a default tz to new 
tables, different explicit timezones, vectorized reading on and off).
    
    TODO
    * [ ] predicate pushdown

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/squito/spark SPARK-12297

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/16781.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16781
    
----

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to