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

TP Boudreau commented on ARROW-5889:
------------------------------------

That's correct.  An Arrow timestamp field either has a timezone or doesn't so 
we can always directly report that the isAdjustedToUTC is true or false 
(respectively).  So that field can be converted to a Parquet node with a user 
supplied TimestampLogicalType (with fromConvertedType := false, as you surmise) 
which can then be memorialized in the Parquet file, without the 
fromConvertedType flag of course, but correctly and unambiguously.

It's only when constructing the logical type from a Parquet file that has only 
converted types where fromConvertedType would be true.  Then passing the 
Parquet node thru to an Arrow field we could create a timezone-naive timestamp 
field (restoring the behavior requested in this issue).  After that we have a 
well-formed Arrow field, so we can goto the first paragraph of this comment.

[The reason for declining to write a TimestampLogicalType that came from a 
converted type is so that a non-Arrow parquet user who does a read followed by 
write doesn't change the semantics of the TIMESTAMP converted type by coercing 
it to a TimestampType with UTCAdjusted := true (as the parquet.thrift spec 
currently demands).  For that user, whatever TIMESTAMP meant before, it still 
means and it's still the controlling annotation for the column.]

Hope that helps.  (It helped me, so thanks!)

Unless I hear a hard "No" on this, I'm going to start hacking on this first 
option (mostly to gain confidence that it'll work), but also to see how 
non-intrusive a change I can make it.

 

> [Python][C++] Parquet backwards compat for timestamps without timezone broken
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-5889
>                 URL: https://issues.apache.org/jira/browse/ARROW-5889
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 0.14.0
>            Reporter: Florian Jetter
>            Priority: Minor
>              Labels: parquet
>             Fix For: 0.14.1
>
>         Attachments: 0.12.1.parquet, 0.13.0.parquet
>
>
> When reading a parquet file which has timestamp fields they are read as a 
> timestamp with timezone UTC if the parquet file was written by pyarrow 0.13.0 
> and/or 0.12.1.
> Expected behavior would be that they are loaded as timestamps without any 
> timezone information.
> The attached files contain one row for all basic types and a few nested 
> types, the timestamp fields are called datetime64 and datetime64_tz
> see also 
> [https://github.com/JDASoftwareGroup/kartothek/tree/master/reference-data/arrow-compat]
> [https://github.com/JDASoftwareGroup/kartothek/blob/c47e52116e2dc726a74d7d6b97922a0252722ed0/tests/serialization/test_arrow_compat.py#L31]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to