cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-14724) Duration addition to Date/Timestamp is broken for leapseconds
Date Mon, 17 Sep 2018 10:25:00 GMT

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

Benedict commented on CASSANDRA-14724:
--------------------------------------

bq. If you want to fetch all the data from the last 2 days but do not care that the day lasted
23, 24 or 25 hours you should query the data using a query like {{SELECT * FROM myTable WHERE
pk = `XXX` AND operationTime > ? - 2d}}.

But this isn't the case - it will give them either 1 extra or 1 fewer hours?  We equate -2d
with precisely -2*24*60*60*1000000ns, whatever the TZ or instant.

bq. In my opinion for DST it is the correct behavior because it allows you to query exactly
the data that you want.

But as shown above, it doesn't, and it seems like even you are confused by this?  Unless I
am mistaken, in which case I am confused by it.  In either case, it doesn't bode well for
our users.

> Duration addition to Date/Timestamp is broken for leapseconds
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-14724
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14724
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Benedict
>            Assignee: Benjamin Lerer
>            Priority: Major
>              Labels: correctness
>
> Hours, Minutes and Seconds are not always of the same duration; it varies when they cross
a leap second (or DST boundary).  When we add durations to instants, we do not account for
this (as we have by then lost the necessary information).  Duration should take (and store)
all components of time.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message