cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-7792) Fix cqlsh null handling in COPY FROM
Date Tue, 19 Aug 2014 18:33:18 GMT
Tyler Hobbs created CASSANDRA-7792:

             Summary: Fix cqlsh null handling in COPY FROM
                 Key: CASSANDRA-7792
             Project: Cassandra
          Issue Type: Bug
          Components: Tools
            Reporter: Tyler Hobbs
            Assignee: Tyler Hobbs
            Priority: Minor
             Fix For: 2.1.0

In {{create_insert_statement()}}, we have the following logic:

if value != nullval:
    if cqltype in ('ascii', 'text', 'timestamp', 'inet'):
        rowmap[name] = protect_value(value)
        rowmap[name] = value
elif name in clustering_key_columns and not type.empty_binary_ok:
    rowmap[name] = 'blobAs%s(0x)' % cqltype.title()
    rowmap[name] = 'null'

The first problem is that we're inserting empty binaries when the type should _not_ have empty

However, it could also be considered incorrect that we insert empty binaries for clustering
columns when we have something that matches the "null value".  This is to avoid inserting
nulls for clustering columns.  Of course, users may actually want to insert empty strings
for columns, but I think that if they want that behavior, changing the null value is the correct
way to do that.

I propose changing the "elif" statement to something like:

elif name in primary_key_columns:
    raise Exception("Nulls are not allowed in primary key columns")    

I set the fix version for this to 2.1.0.  If we're not comfortable making this entire change
in 2.1.0, we should at least remove the "not" in the elif and make the other changes for 2.1.1

This message was sent by Atlassian JIRA

View raw message