You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2020/12/07 15:49:00 UTC
[jira] [Resolved] (ARROW-10337) [C++] More liberal parsing of
ISO8601 timestamps with fractional seconds
[ https://issues.apache.org/jira/browse/ARROW-10337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antoine Pitrou resolved ARROW-10337.
------------------------------------
Fix Version/s: 3.0.0
Resolution: Fixed
Issue resolved by pull request 8692
[https://github.com/apache/arrow/pull/8692]
> [C++] More liberal parsing of ISO8601 timestamps with fractional seconds
> ------------------------------------------------------------------------
>
> Key: ARROW-10337
> URL: https://issues.apache.org/jira/browse/ARROW-10337
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Reporter: Frank Smith
> Assignee: Frank Smith
> Priority: Minor
> Labels: pull-request-available
> Fix For: 3.0.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The current ISO8601 timestamp parser assumes MILLI timestamps have 3 decimal places, MICRO have 6 and NANO have 9. From ParseTimestampISO8601 in cpp/src/arrow/util/value_parsing.h:
> {{ // We allow the following formats for all units:}}
> {{ // - "YYYY-MM-DD"}}
> {{ // - "YYYY-MM-DD[ T]hh"}}
> {{ // - "YYYY-MM-DD[ T]hhZ"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm"}}
> {{ // - "YYYY-MM-DD[ T]hh:mmZ"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ssZ"}}
> {{ //}}
> {{ // We allow the following formats for unit==MILLI:}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.mmm"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.mmmZ"}}
> {{ //}}
> {{ // We allow the following formats for unit==MICRO:}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.uuuuuu"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.uuuuuuZ"}}
> {{ //}}
> {{ // We allow the following formats for unit==NANO:}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.nnnnnnnnn"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.nnnnnnnnnZ"}}
> {{ //}}
> I propose that we change the parser to accept 1 to 3 digits for MILLI, 1 to 6 digits for MICRO, and 1 to 9 digits for NANO, as follows:
> {{ // We allow the following formats for all units:}}
> {{ // - "YYYY-MM-DD"}}
> {{ // - "YYYY-MM-DD[ T]hhZ?"}}
> {{ // - "YYYY-MM-DD[ T]hh:mmZ?"}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ssZ?"}}
> {{ //}}
> {{ // We allow the following formats for unit == MILLI, MICRO, or NANO:}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.s\{1,3}Z?"}}
> {{ //}}
> {{ // We allow the following formats for unit == MICRO, or NANO:}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.s\{4,6}Z?"}}
> {{ //}}
> {{ // We allow the following formats for unit == NANO:}}
> {{ // - "YYYY-MM-DD[ T]hh:mm:ss.s\{7,9}Z?"}}
> This will allow for parsing of timestamps when e.g. a CSV file does not write timestamps with trailing zeroes.
> I am almost complete implementing this functionality, so a PR will be following soon.
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)