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

Cassandra: Insert of null value not possible with CQL3?

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Not A Problem
    • Fix Version/s: 1.2.6
    • Component/s: Legacy/CQL
    • Labels:
      None
    • Severity:
      Normal

      Description

      Hi there,

      I'm trying to migrate a project from thrift to cql3/java driver and I'm experiencing a strange problem.

      Schema:

      CREATE TABLE foo (
        key ascii,
        column1 ascii,
        foo ascii,
        PRIMARY KEY (key, column1)
      ) WITH COMPACT STORAGE;
      

      The table just consists of a primary key and a value, sometimes all the information lies in the key though, so the value is not needed.
      Through the thrift interface, it just works fine to leave out "foo".
      Executing this query:

      INSERT INTO foo(key, column1) VALUES ('test', 'test2');
      

      Fails with
      "Bad Request: Missing mandatory column foo"

      though.

      Explicitly inserting "null" as a value does not store the column / deletes the old one with a "null" value inserted through thrift.

      Inserting an empty String works fine, but this seems a bit bloated.

      Is this intended to (not) work this way?

      Best,

      Tobias

        Attachments

          Activity

            People

            • Assignee:
              aleksey Aleksey Yeschenko
              Reporter:
              tobsch Tobias Schlottke
              Authors:
              Aleksey Yeschenko
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: