Skip to content

Support frozen collections with FULL indexes in cqlengine #677

@dkropachev

Description

@dkropachev

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions