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

Improve messaging on indexing frozen collections

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 4.0-beta1, 4.0
    • CQL/Semantics
    • None

    Description

      When attempting to create an index on a frozen collection the error message produced can be improved to provide more detail about the problem and possible workarounds. Currently, a user will receive a message indicating "...Frozen collections only support full() indexes" which is not immediately clear for users new to Cassandra indexing and datatype compatibility.

      Here is an example:

      cqlsh> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
      
      cqlsh> CREATE TABLE test.mytable ( id int primary key, addresses frozen<set<text>> );
      
      cqlsh> CREATE INDEX mytable_addresses_idx on test.mytable (addresses);
       InvalidRequest: Error from server: code=2200 [Invalid query] message="Cannot create values() index on frozen column addresses. Frozen collections only support full() indexes"

       

      I'm proposing possibly enhancing the messaging to something like this.

      Cannot create values() index on frozen column addresses. Frozen collections only support indexes on the entire data structure due to immutability constraints of being frozen, wrap your frozen column with the full() target type to index properly.

      Attachments

        Activity

          People

            rocco.varela Rocco Varela
            rocco.varela Rocco Varela
            Rocco Varela
            Brandon Williams, Bryn Cooke, Zhao Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m