Hacker News new | ask | show | jobs
by the__alchemist 15 days ago
Arrow has no date type. No time type either! Using their recommended approach of "use datetimes for everything" is a poor representation of data in many scenarios and leads to surprise behavior. Chrono's sins, as enumerated in the Jiff documents, aren't on the same tier.

Unless you're talking about Arrow, the Apache Parquet interface library in either Python or Rust - that's a different matter; great software!

1 comments

I am trying to find a case where a time without a date would be useful. The only one I can think about are analog monotonic clocks.

In any other case I can think of, you need to attach the time to a date and a timezone. You can display it bare in the context of the viewer (who has an implicit or explicit timezone and time reference) but any manipulation without these will not end well.

Would you have some examples for the poor representation of data and surprise behaviour?

TLDR: Think about how to represent various things in a struct field[s]. Sometimes the time or date information isn't part of state, and adding it is an overconstraint.

What datetime is your annual birthday celebration? When's Christmas this year? What time is your Monday alarm clock set for? Wen's the daily standup?

There are so many, and sometimes Arrow/Moment's abstraction is OK. Other times it's awkward as it overconstrains. Sometimes it has surprising behavior.

Or, ask yourself why Jiff and Chrono, and python datetime etc have separate date, time, and datetime types.

Datetimes are useful, and I use them more than individual dates and times. The latter 2 are still useful, and datetime is a sloppy or buggy fit.

My best guess of your (and the arrow and moment creator's mentality here): They have been hit by bugs of the kind you're saying, involving timezones, or things that should be datetimes + timezone, but were using native datetimes, or dates etc. The response was to use datetimes for everything, ignoring other cases. Does that sound accurate?

>What datetime is your annual birthday celebration?

Doesn't that belong to a scheduler library?