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

Column names are not converted correctly for non-text comparators

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.0.12, 2.1.2
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal

      Description

      If a column family is created with a non-text comparator through Thrift (or cassandra-cli) and column metadata is defined, those column names cannot be queried through cql3.

      For example:

      [default@ks1] create column family entity_data
      ...   with column_type = 'Standard'
      ...   and comparator = 'BytesType'
      ...   and default_validation_class = 'BytesType'
      ...   and key_validation_class = 'UTF8Type'
      ...   and column_metadata = [
      ...     {column_name : '0008',
      ...     validation_class : UTF8Type,
      ...     index_name : 'entity_data_0008_idx',
      ...     index_type : 0}];
      

      When you attempt to query that column through cqlsh, you'll get an error like this:

      cqlsh:ks1> select "0008" FROM entity_data ;
      Bad Request: Undefined name 0008 in selection clause
      

      The problem is that we aren't taking the comparator type into account when converting column names in cql3 statements to their internal (ByteBuffer) representation.

        Attachments

        1. 8178-2.0.txt
          60 kB
          Tom Hobbs

          Issue Links

            Activity

              People

              • Assignee:
                thobbs Tom Hobbs
                Reporter:
                thobbs Tom Hobbs
                Authors:
                Tom Hobbs
                Reviewers:
                Aleksey Yeschenko
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: