[ 
https://issues.apache.org/jira/browse/CASSANDRA-11798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joshua McKenzie updated CASSANDRA-11798:
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.8
                   3.8
           Status: Resolved  (was: Ready to Commit)

Looks like a simple oversight when I originally implemented the type.

[Committed|https://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=commit;h=863dbc78777101eab08f23877a4d9ffc92ffb6b4]
 to 3.0 and trunk since 3.7 is already cut.

Thanks for adding the test in there as well!

> Allow specification of 'time' column value as number in CQL query.
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-11798
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11798
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Andy Tolbert
>            Assignee: Alex Petrov
>            Priority: Minor
>             Fix For: 3.8, 3.0.8
>
>
> The 'time' cql type is internally stored and sent over the protocol as an 
> 8-byte long value representing nanoseconds since midnight.   
> When specifying a time column value as a number in a simple statement,, C* 
> currently responds with:
> {noformat}
> InvalidRequest: code=2200 [Invalid query] message="Invalid INTEGER constant 
> (42000000000) for "time" of type time"
> {noformat}
> Instead one must provide this value as a string (i.e. {{'42000000000'}}) or 
> use an {{HH.MM.SS.sssssssss}} format (i.e. {{'00:00:42.000000000'}}).  It 
> would be nice if it supported unquoted numbers as well.
> Example:
> {code}
> cqlsh:simple> CREATE TABLE timeentity (id varchar PRIMARY KEY, time time);
> # Doesn't work
> cqlsh:simple> INSERT into timeentity (id, time) values ('1', 42000000000);
> InvalidRequest: code=2200 [Invalid query] message="Invalid INTEGER constant 
> (42000000000) for "time" of type time"
> # Works
> cqlsh:simple> INSERT into timeentity (id, time) values ('1', '42000000000');
> {code}
> When using prepared statements or simple statements with parameters, one 
> could provide a long value, depending on the driver implementation.  I.E. the 
> java driver has {{setTime(int index, long v)}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to