forked from apache/cassandra-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Background
Currently, cqlengine only supports non-frozen collection columns with secondary indexes (VALUES indexing). There's no way to create frozen collections with FULL indexes.
Current Behavior
class MyModel(Model):
id = columns.Integer(primary_key=True)
items = columns.List(columns.Text, index=True)Generates:
CREATE TABLE mymodel (id int PRIMARY KEY, items list<text>);
CREATE INDEX ON mymodel (items); -- VALUES index (implicit)Desired Feature
Support frozen collections with FULL indexes:
class MyModel(Model):
id = columns.Integer(primary_key=True)
items = columns.List(columns.Text, frozen=True, index=True)Should generate:
CREATE TABLE mymodel (id int PRIMARY KEY, items frozen<list<text>>);
CREATE INDEX ON mymodel (FULL(items));Query Behavior Differences
| Collection Type | Index Type | Supported Queries |
|---|---|---|
| Non-frozen list | VALUES (implicit) | WHERE items CONTAINS 'value' |
| Frozen list | FULL | WHERE items = ['exact', 'match'] |
References
Metadata
Metadata
Assignees
Labels
No labels