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

Stefania commented on CASSANDRA-12863:
--------------------------------------

The patch is here, it applies cleanly to all branches.

||2.2||3.0||3.X||trunk||
|[patch|https://github.com/stef1927/cassandra/tree/12863-cqlsh-2.2]|[patch|https://github.com/stef1927/cassandra/tree/12863-cqlsh-3.0]|[patch|https://github.com/stef1927/cassandra/tree/12863-cqlsh-3.X]|[patch|https://github.com/stef1927/cassandra/tree/12863-cqlsh]|
|[cqlsh 
tests|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12863-cqlsh-2.2-cqlsh-tests/]|[cqlsh
 
tests|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12863-cqlsh-3.0-cqlsh-tests/]|[cqlsh
 
tests|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12863-cqlsh-3.X-cqlsh-tests/]|[cqlsh
 
tests|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12863-cqlsh-cqlsh-tests/]|

[~pauloricardomg] or [~thobbs], would you have time to review this super-simple 
patch?

> cqlsh COPY FROM cannot parse timestamp in partition key if table contains a 
> counter value
> -----------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-12863
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12863
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Stefania
>            Assignee: Stefania
>             Fix For: 2.2.x, 3.0.x, 3.x
>
>
> This sample table:
> {code}
> CREATE TABLE test (columnname text, day timestamp, israndom boolean, 
> columnvalue text, counter counter, PRIMARY KEY ((columnname, day, israndom), 
> columnvalue));
> {code}
> with this sample data:
> {code}
> origins|2016-10-01 00:00:00+0000|False|ACTUAL|6
> origins|2016-10-01 00:00:00+0000|False|ADGMOB|4
> origins|2016-10-01 00:00:00+0000|False|ANONPM|4
> origins|2016-10-01 00:00:00+0000|False|CSRT2L|76
> origins|2016-10-01 00:00:00+0000|False|DIAGOP|18
> origins|2016-10-01 00:00:00+0000|False|E-SOFT|17
> origins|2016-10-01 00:00:00+0000|False|E-TASK|10
> {code}
> when imported with
> {code}
> COPY ks.test FROM 'test.csv' WITH DELIMITER = '|';
> {code}
> will generate a parse error:
> {code}
> Failed to import 7 rows: ParseError - can't interpret u"'2016-10-01 
> 00:00:00+0000'" as a date with this format: %Y-%m-%d %H:%M:%S%z,  given up 
> without retries
> {code}
> The problem is that when a counter value is present, we don't use prepared 
> statements and hence add quotes to certain types, such as timestamps. 
> However, because the timestamp is part of the partition key, we must parse it 
> in order to determine the routing token. Here lies the problem, we do not 
> remove the quotes before parsing the partition key, therefore ending up with 
> a parse error.



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

Reply via email to