Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-4831

CQL DELETE can not be used without where clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Not A Problem
    • None
    • None
    • CQLSH

    • Normal

    Description

      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>

      Attachments

        Activity

          People

            Unassigned Unassigned
            skuppa Sridharan Kuppa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: