Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Correctness - API / Semantic Implementation
-
Critical
-
Low Hanging Fruit
-
Fuzz Test
-
All
-
None
-
Description
CREATE TABLE tbl ( pk int, ck frozen<list<int>>, value int, PRIMARY KEY(pk, ck) ) WITH CLUSTERING ORDER BY (ck DESC)
If you index “ck” it will fail
CREATE INDEX ON tbl(FULL(ck));
The failure error is
Caused by: org.apache.cassandra.exceptions.InvalidRequestException: full() indexes can only be created on frozen collections at org.apache.cassandra.cql3.statements.schema.AlterSchemaStatement.ire(AlterSchemaStatement.java:222) at org.apache.cassandra.cql3.statements.schema.CreateIndexStatement.validateIndexTarget(CreateIndexStatement.java:250) at org.apache.cassandra.cql3.statements.schema.CreateIndexStatement.lambda$apply$1(CreateIndexStatement.java:177)
The reason? We have a ReverseType column! We must “unwrap” the type before this check...
Basic test
schemaChange(format("CREATE TABLE %s.tbl (\n" + " pk int,\n" + " ck frozen<list<int>>,\n" + " value int,\n" + " PRIMARY KEY(pk, ck)\n" + ")\n" + "WITH CLUSTERING ORDER BY (ck DESC)", KEYSPACE)); schemaChange(format("CREATE INDEX ON %s.tbl(FULL(ck));", KEYSPACE));
Attachments
Issue Links
- links to