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

Joel Knighton edited comment on CASSANDRA-12360 at 8/4/16 8:51 PM:
-------------------------------------------------------------------

I thought I'd share a few points in case someone wants to pick this up.

[~jeromatron]'s example won't parse not because of the negative year but 
because of the time component.

The newer date type parses negative years just fine because it uses Joda-Time. 
The timestamp type does not parse negative years because it uses 
{{SimpleDateFormat}}, which would need an era signifier in the parse patterns 
instead. It may make sense to move the timestamp type parsing to Joda-Time if 
we can show this doesn't change any of the existing parse behavior.


was (Author: jkni):
I thought I'd share a few points in case someone wants to pick this up.

Jeremy's example won't parse not because of the negative year but because of 
the time component.

The newer date type parses negative years just fine because it uses Joda-Time. 
The timestamp type does not parse negative years because it uses 
{{SimpleDateFormat}}, which would need an era signifier in the parse patterns 
instead. It may make sense to move the timestamp type parsing to Joda-Time if 
we can show this doesn't change any of the existing parse behavior.

> Unable to parse negative dates
> ------------------------------
>
>                 Key: CASSANDRA-12360
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12360
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Bryn Cooke
>
> {code}
> cqlsh:date_test> DESC test;
> CREATE TABLE date_test.test (
>     date timestamp PRIMARY KEY
> ) ...
> cqlsh:date_test> INSERT INTO test (date) VALUES ('-0407-12-27T00:00:00Z');
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Unable 
> to coerce '-0407-12-27T00:00:00Z' to a formatted date (long)"
> {code}



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

Reply via email to