Skip to content

Finalize Date type #15766

Closed
Closed

Description

@asfimport

Parquet defines it as: "number of days from the Unix epoch, 1 January 1970."
https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#datetime-types

We should make it the same.

Reporter: Julien Le Dem / @julienledem
Assignee: Wes McKinney / @wesm

Related issues:

Note: This issue was originally created as ARROW-316. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Oct 3, 2016

    @asfimport
    Author
  2. asfimport commented on Mar 13, 2017

    @asfimport
    Author

    Wes McKinney / @wesm:
    So in the end we are using int64 milliseconds since the UNIX epoch – we do have a date32 type in the C++ implementation since days-since-UNIX-epoch occurs frequently in the wild. We can document this in the format/ section to close this issue, anything else to discuss?

  3. asfimport commented on Mar 16, 2017

    @asfimport
    Author

    Julien Le Dem / @julienledem:
    What representations do we need?

    • millisecond since the UNIX epoch on 64 bits: does this mean the timestamp at midnight? This is not the same as number of days * 24 * 3600 * 1000 because of leap seconds.
    • number of days since the UNIX epoch on int32. This one seems straightforward.

    Do we want to make the Date type more explicit similar to the current Time type discussion? Meaning it has a unit and a bitWidth? This seems overkill since the precision is always day.

  4. asfimport commented on Mar 16, 2017

    @asfimport
    Author

    Wes McKinney / @wesm:
    @julienledem I guess we should revise the description to be "UNIX time", which does not include leap seconds (https://en.wikipedia.org/wiki/Unix_time).

    One option is to add an enum like:

    enum DateUnit: short { 
      DAY,   /// 32-bit storage
      MILLISECOND,   /// 64-bit storage
    }

    and add that to the Date flatbuffer table.

  5. asfimport commented on Mar 16, 2017

    @asfimport
    Author

    Wes McKinney / @wesm:
    In the interest of an expedient resolution, I opened PR #390 for discussion.

    As an extra data point, the DateUnit::DAY 32-bit representation is the one used by PostgreSQL.

  6. asfimport commented on Mar 20, 2017

    @asfimport
    Author

    Julien Le Dem / @julienledem:
    Issue resolved by pull request 390
    #390

  7. asfimport commented on Mar 20, 2017

    @asfimport
    Author

    Luke Higgins:
    sure you don't want to account for leap seconds? On CentOS7 for example unix time from date command does give current UTC (which is adjusted for leap seconds). If I am timestamping events on my unix host and storing them the timestamp will most likely be UTC (modulo timezone locale perhaps)

  8. asfimport commented on Mar 20, 2017

    @asfimport
    Author

    Wes McKinney / @wesm:
    [~virtualluke] do you have any documentation about that? The date command returns the current system time, which does account for leap seconds. When there is a leap second, the same second occurs twice https://access.redhat.com/articles/15145. As far as the actual UNIX timestamps, my understanding is that they do not include leap seconds.

  9. asfimport commented on Mar 20, 2017

    @asfimport
    Author

    Luke Higgins:
    I was wrong, read some documentation on the date command incorrectly. Looks like storing without leap seconds is pretty universal.

  10. added this to the 0.3.0 milestone on Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions