You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2019/07/10 14:12:00 UTC

[jira] [Comment Edited] (ARROW-5888) [Python][C++] Add metadata to store Arrow time zones in Parquet file metadata

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

Wes McKinney edited comment on ARROW-5888 at 7/10/19 2:11 PM:
--------------------------------------------------------------

I updated the JIRA to indicate that this is a new feature. I suggest that we use a similar metadata naming scheme (as we are using for reserved fields like extension types in Arrow metadata) like {{ARROW:timezone}} in the key-value metadata in the schema


was (Author: wesmckinn):
I updated the JIRA to indicate that this is a new feature. I suggest that we use a similar metadata naming scheme like {{ARROW:timezone}} in the key-value metadata in the schema

> [Python][C++] Add metadata to store Arrow time zones in Parquet file metadata
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-5888
>                 URL: https://issues.apache.org/jira/browse/ARROW-5888
>             Project: Apache Arrow
>          Issue Type: Improvement
>            Reporter: Florian Jetter
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> The timezone is not roundtrip safe for timezones other than UTC when storing to parquet. Expected behavior would be that the timezone is properly reconstructed
> {code:python}
> schema = pa.schema(
>     [
>         pa.field("no_tz", pa.timestamp('us')),
>         pa.field("no_tz", pa.timestamp('us', tz="UTC")),
>         pa.field("no_tz", pa.timestamp('us', tz="Europe/Berlin")),
> ]
> )
> buf = pa.BufferOutputStream()
> pq.write_metadata(
>     schema,
>     buf,
>     coerce_timestamps="us"
> )
> pq_bytes = buf.getvalue().to_pybytes()
> reader = pa.BufferReader(pq_bytes)
> parquet_file = pq.ParquetFile(reader)
> parquet_file.schema.to_arrow_schema()
> # Output:
> # no_tz: timestamp[us]
> # utc: timestamp[us, tz=UTC]
> # europe: timestamp[us, tz=UTC]
> {code}



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