[ 
https://issues.apache.org/jira/browse/CASSANDRA-15908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148243#comment-17148243
 ] 

Rocco Varela commented on CASSANDRA-15908:
------------------------------------------

I still have more tests to run to make sure these changes don't break anything, 
but I've linked a PR above.

> Improve messaging on indexing frozen collections
> ------------------------------------------------
>
>                 Key: CASSANDRA-15908
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15908
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Semantics
>            Reporter: Rocco Varela
>            Assignee: Rocco Varela
>            Priority: Low
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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:
> {code:java}
> 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"{code}
>  
> I'm proposing possibly enhancing the messaging to something like this.
> {quote}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.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to