cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefania (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-12476) SyntaxException when COPY FROM Counter Table with Null value
Date Mon, 22 Aug 2016 04:14:20 GMT

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

Stefania commented on CASSANDRA-12476:
--------------------------------------

Thank you for the patch but, unless it's absolutely necessary that the missing counter stays
as null, I prefer to fix this by changing counter null values to zero. The reason is that
this is consistent with how we handle null values elsewhere. Also, if we skip null values,
then the patch needs to be enhanced to cope with an empty set clause.

Here is my suggested patch:

||2.2||3.0||3.9||trunk||
|[patch|https://github.com/stef1927/cassandra/commits/12476-cqlsh-2.2]|[patch|https://github.com/stef1927/cassandra/commits/12476-cqlsh-3.0]|[patch|https://github.com/stef1927/cassandra/commits/12476-cqlsh-3.9]|[patch|https://github.com/stef1927/cassandra/commits/12476-cqlsh]|
|[dtest|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12476-cqlsh-2.2-cqlsh-tests/]|[dtest|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12476-cqlsh-3.0-cqlsh-tests/]|[dtest|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12476-cqlsh-3.9-cqlsh-tests/]|[dtest|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12476-cqlsh-cqlsh-tests/]|

Here is the test to reproduce the problem: https://github.com/stef1927/cassandra-dtest/commits/12476

We possibly have CASSANDRA-12471 related to this, where we would skip null values rather then
insert them as null or zero, although I'm still clarifying if that's the exact requirement
for that ticket.

> SyntaxException when COPY FROM Counter Table with Null value
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-12476
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12476
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Ashraful Islam
>            Priority: Minor
>              Labels: cqlsh
>             Fix For: 3.0.x, 3.x
>
>         Attachments: Fix_issue___CASSANDRA_12476__SyntaxException_when_COPY_FROM_Counter_Table_with_Null_value.patch
>
>
> I have a simple counter table 
> {noformat}
> CREATE TABLE test (
>     a int PRIMARY KEY,
>     b counter,
>     c counter
> ) ;
> {noformat}
> I have updated b column value with 
> {noformat}
> UPDATE test SET b = b + 1 WHERE a = 1;
> {noformat}
> Now I have export the data with 
> {noformat}
> COPY test TO 'test.csv';
> {noformat}
> And Import it with 
> {noformat}
> COPY test FROM 'test.csv';
> {noformat}
> I get this Error
> {noformat}
> Failed to import 1 rows: SyntaxException - line 1:34 no viable alternative at input 'WHERE'
(...=b+1,c=c+ [WHERE]...) -  will retry later, attempt 1 of 5
> {noformat}



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

Mime
View raw message