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

Benjamin Lerer commented on CASSANDRA-13218:
--------------------------------------------

Unfortunately, there are other factors that force us to use 32-bit values for 
months and days. Java utilities like {{Calendar}} accept only {{int}} for 
months or days value and we already use {{Calendar}} for data arithmetics. Due 
to that the solution is simply to reject to values at write time.

I pushed a patch for that 
[here|https://github.com/apache/cassandra/compare/trunk...blerer:13128-3.11].

I think that the chances that users have inserted illegal durations is rather 
null. 
The 2 reasons for that are that:
# duration is not really usefull in itself and was mainly added for simplifying 
the life of user querying timeseries data
# the invalid values are greater than the age of mankind and by consequence 
have not much sense in the real life

[~adelapena] could you review? 

> Duration validation error is unclear in case of overflow.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-13218
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13218
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>             Fix For: 3.11.x
>
>
> If a user try to insert a {{duration}} with a number of months or days that 
> cannot fit in an {{int}} (for example: {{9223372036854775807mo1d}}), the 
> error message is confusing.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to