You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sridharan Kuppa (JIRA)" <ji...@apache.org> on 2012/10/18 07:16:05 UTC

[jira] [Created] (CASSANDRA-4831) CQL DELETE can not be used without where clause

Sridharan Kuppa created CASSANDRA-4831:
------------------------------------------

             Summary: CQL DELETE can not be used without where clause
                 Key: CASSANDRA-4831
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4831
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.5
         Environment: CQLSH
            Reporter: Sridharan Kuppa


 I have created table schema using CQL, and I am able to insert and select from that table.  Everything works great but DELETE is not working.  When I execute the DELETE statement it throws "Bad Request: Failed parsing statement: [COL1, COL2, from TABLE1;] reason NullPointerException: null"  I tried without column names and with column names but always throws the same exception. But it works only if where is clause is specified.  The problem can be easily visualize using the cqlsh.

Connected to Test Cluster at localhost:9160.
[cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 2.0.0 | Thrift protocol 19.32.0]
Use HELP for help.
cqlsh>
cqlsh> use demo1;
cqlsh:demo1> create table user (id varchar primary key, fname varchar, lname varchar);
cqlsh:demo1> insert into user (id, fname, lname) values (1, 'john', 'doe');
cqlsh:demo1> insert into user (id, fname, lname) values (2, 'foo', 'bar');
cqlsh:demo1> delete from user;
Bad Request: Failed parsing statement: [delete from user;] reason: NullPointerException null
cqlsh:demo1> delete fname, lname from user;
Bad Request: Failed parsing statement: [delete fname, lname from user;] reason: NullPointerException null
cqlsh:demo1> delete from user where id = 2;
cqlsh:demo1>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4831) CQL DELETE can not be used without where clause

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479318#comment-13479318 ] 

Jonathan Ellis commented on CASSANDRA-4831:
-------------------------------------------

Do you get the same error with cql3?
                
> CQL DELETE can not be used without where clause
> -----------------------------------------------
>
>                 Key: CASSANDRA-4831
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4831
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.5
>         Environment: CQLSH
>            Reporter: Sridharan Kuppa
>              Labels: cql, delete, nullpointer
>
>  I have created table schema using CQL, and I am able to insert and select from that table.  Everything works great but DELETE is not working.  When I execute the DELETE statement it throws "Bad Request: Failed parsing statement: [COL1, COL2, from TABLE1;] reason NullPointerException: null"  I tried without column names and with column names but always throws the same exception. But it works only if where is clause is specified.  The problem can be easily visualize using the cqlsh.
> Connected to Test Cluster at localhost:9160.
> [cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 2.0.0 | Thrift protocol 19.32.0]
> Use HELP for help.
> cqlsh>
> cqlsh> use demo1;
> cqlsh:demo1> create table user (id varchar primary key, fname varchar, lname varchar);
> cqlsh:demo1> insert into user (id, fname, lname) values (1, 'john', 'doe');
> cqlsh:demo1> insert into user (id, fname, lname) values (2, 'foo', 'bar');
> cqlsh:demo1> delete from user;
> Bad Request: Failed parsing statement: [delete from user;] reason: NullPointerException null
> cqlsh:demo1> delete fname, lname from user;
> Bad Request: Failed parsing statement: [delete fname, lname from user;] reason: NullPointerException null
> cqlsh:demo1> delete from user where id = 2;
> cqlsh:demo1>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4831) CQL DELETE can not be used without where clause

Posted by "Sridharan Kuppa (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479323#comment-13479323 ] 

Sridharan Kuppa commented on CASSANDRA-4831:
--------------------------------------------

There is no exception in the cql3, and it is giving an error message that the query is expecting K_WHERE.  It is definitely better than NullPointerException.

$ ./cqlsh --cql3
      1 [main] python2.6 16736 child_info_fork::abort: address space needed by 'fcntl.dll' (0x450000) is already occupied
Connected to Test Cluster at localhost:9160.
[cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 3.0.0 | Thrift protocol 19.32.0]
Use HELP for help.
cqlsh> use demo1;
cqlsh:demo1> create table user (id varchar primary key, fname varchar, lname varchar);
cqlsh:demo1> insert into user (id, fname, lname) values (1, 'john', 'doe');
cqlsh:demo1> insert into user (id, fname, lname) values (2, 'foo', 'bar');
cqlsh:demo1> delete from user;
Bad Request: line 1:16 mismatched input ';' expecting K_WHERE
cqlsh:demo1> delete fname, lname from user;
Bad Request: line 1:29 mismatched input ';' expecting K_WHERE
cqlsh:demo1> delete from user where id = 2;
cqlsh:demo1>
                
> CQL DELETE can not be used without where clause
> -----------------------------------------------
>
>                 Key: CASSANDRA-4831
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4831
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.5
>         Environment: CQLSH
>            Reporter: Sridharan Kuppa
>              Labels: cql, delete, nullpointer
>
>  I have created table schema using CQL, and I am able to insert and select from that table.  Everything works great but DELETE is not working.  When I execute the DELETE statement it throws "Bad Request: Failed parsing statement: [COL1, COL2, from TABLE1;] reason NullPointerException: null"  I tried without column names and with column names but always throws the same exception. But it works only if where is clause is specified.  The problem can be easily visualize using the cqlsh.
> Connected to Test Cluster at localhost:9160.
> [cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 2.0.0 | Thrift protocol 19.32.0]
> Use HELP for help.
> cqlsh>
> cqlsh> use demo1;
> cqlsh:demo1> create table user (id varchar primary key, fname varchar, lname varchar);
> cqlsh:demo1> insert into user (id, fname, lname) values (1, 'john', 'doe');
> cqlsh:demo1> insert into user (id, fname, lname) values (2, 'foo', 'bar');
> cqlsh:demo1> delete from user;
> Bad Request: Failed parsing statement: [delete from user;] reason: NullPointerException null
> cqlsh:demo1> delete fname, lname from user;
> Bad Request: Failed parsing statement: [delete fname, lname from user;] reason: NullPointerException null
> cqlsh:demo1> delete from user where id = 2;
> cqlsh:demo1>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CASSANDRA-4831) CQL DELETE can not be used without where clause

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-4831.
---------------------------------------

    Resolution: Not A Problem

Thanks for looking into that.  CQL2 is maintenance-mode only so we'll note that as a known problem there.
                
> CQL DELETE can not be used without where clause
> -----------------------------------------------
>
>                 Key: CASSANDRA-4831
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4831
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.5
>         Environment: CQLSH
>            Reporter: Sridharan Kuppa
>              Labels: cql, delete, nullpointer
>
>  I have created table schema using CQL, and I am able to insert and select from that table.  Everything works great but DELETE is not working.  When I execute the DELETE statement it throws "Bad Request: Failed parsing statement: [COL1, COL2, from TABLE1;] reason NullPointerException: null"  I tried without column names and with column names but always throws the same exception. But it works only if where is clause is specified.  The problem can be easily visualize using the cqlsh.
> Connected to Test Cluster at localhost:9160.
> [cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 2.0.0 | Thrift protocol 19.32.0]
> Use HELP for help.
> cqlsh>
> cqlsh> use demo1;
> cqlsh:demo1> create table user (id varchar primary key, fname varchar, lname varchar);
> cqlsh:demo1> insert into user (id, fname, lname) values (1, 'john', 'doe');
> cqlsh:demo1> insert into user (id, fname, lname) values (2, 'foo', 'bar');
> cqlsh:demo1> delete from user;
> Bad Request: Failed parsing statement: [delete from user;] reason: NullPointerException null
> cqlsh:demo1> delete fname, lname from user;
> Bad Request: Failed parsing statement: [delete fname, lname from user;] reason: NullPointerException null
> cqlsh:demo1> delete from user where id = 2;
> cqlsh:demo1>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4831) CQL DELETE can not be used without where clause

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478720#comment-13478720 ] 

Sylvain Lebresne commented on CASSANDRA-4831:
---------------------------------------------

The error message is clearly broken and we should fix that, but we don't support delete queries without a where clause (as in, it's not a CQL limitation or anything, Cassandra just doesn't implement a way to delete some columns for all the keys).
                
> CQL DELETE can not be used without where clause
> -----------------------------------------------
>
>                 Key: CASSANDRA-4831
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4831
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.5
>         Environment: CQLSH
>            Reporter: Sridharan Kuppa
>              Labels: cql, delete, nullpointer
>
>  I have created table schema using CQL, and I am able to insert and select from that table.  Everything works great but DELETE is not working.  When I execute the DELETE statement it throws "Bad Request: Failed parsing statement: [COL1, COL2, from TABLE1;] reason NullPointerException: null"  I tried without column names and with column names but always throws the same exception. But it works only if where is clause is specified.  The problem can be easily visualize using the cqlsh.
> Connected to Test Cluster at localhost:9160.
> [cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 2.0.0 | Thrift protocol 19.32.0]
> Use HELP for help.
> cqlsh>
> cqlsh> use demo1;
> cqlsh:demo1> create table user (id varchar primary key, fname varchar, lname varchar);
> cqlsh:demo1> insert into user (id, fname, lname) values (1, 'john', 'doe');
> cqlsh:demo1> insert into user (id, fname, lname) values (2, 'foo', 'bar');
> cqlsh:demo1> delete from user;
> Bad Request: Failed parsing statement: [delete from user;] reason: NullPointerException null
> cqlsh:demo1> delete fname, lname from user;
> Bad Request: Failed parsing statement: [delete fname, lname from user;] reason: NullPointerException null
> cqlsh:demo1> delete from user where id = 2;
> cqlsh:demo1>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira