Skip to content

feat: Support feature view versioning in the Cassandra online store - #6766

Open
alekseevpavel04 wants to merge 2 commits into
feast-dev:masterfrom
alekseevpavel04:feat/issue-6170-cassandra-feature-view-versioning
Open

feat: Support feature view versioning in the Cassandra online store#6766
alekseevpavel04 wants to merge 2 commits into
feast-dev:masterfrom
alekseevpavel04:feat/issue-6170-cassandra-feature-view-versioning

Conversation

@alekseevpavel04

Copy link
Copy Markdown

What this PR does / why we need it:

Feature view versioning landed in #6101, but the online-store half of it was
only ever implemented for SQLite. Every other store raises
VersionedOnlineReadNotSupported the moment a version-qualified reference such
as driver_stats@v2:trips_today reaches it, so a deployment on Cassandra or
Astra DB cannot use the feature at all. This adds the missing half for
Cassandra, following the six stores that already have it — FAISS (#6256), Redis
and DynamoDB (#6257), PostgreSQL and MySQL (#6193) and Milvus (#6330).

Cassandra builds every table name in one place, _fq_table_name(), shared by
the insert, select, create and drop paths. It now takes the versioning flag and
defers to compute_versioned_name() — the same helper SQLite, MySQL and
PostgreSQL reach through compute_table_id() — so each version of a feature
view gets a table of its own (test_project_driver_stats_v2). The parameter
defaults to False, and with enable_online_feature_view_versioning off the
computed names are byte-for-byte what they are today.

Two details worth flagging for review:

  • Deleting a versioned feature view drops every version of it, not just the
    current one. This follows _drop_all_version_tables in the MySQL and
    PostgreSQL stores rather than SQLite: the in-memory FeatureView carries a
    single version, so dropping only that one would leave the other tables
    orphaned in the keyspace. system_schema cannot match a pattern, so the
    keyspace is listed and the names are filtered in Python.
  • The prepared-statement cache needed no change. It is keyed by the
    formatted statement text, which contains the fully-qualified table name, so
    two versions of a view naturally get two prepared statements.

ScyllaDBOnlineStore has its own copy of _fq_table_name and is deliberately
left alone here — it has a sibling issue of its own.

Which issue(s) this PR fixes:

Fixes #6170

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

New unit tests in
sdk/python/tests/unit/infra/online_store/test_cassandra_versioning.py, 13 of
them, following the shape of test_redis_versioning.py. Ten of the thirteen
fail without the change. They cover the computed name (off by default, off when
versioning is disabled even with a version set, on with
current_version_number, projection.version_tag taking priority over it,
version 0 taking no suffix, and two versions landing on two different
tables), the fact that a version-qualified read no longer raises, and the drop
path — base plus _v1 plus _v2 all removed, a similarly named
driver_stats_extra left alone, and the unversioned teardown still issuing
exactly one DROP.

The full unit suite passes locally: 2648 passed, 44 skipped, 0 failed, against
2635 passed on master before the change — the difference is the 13 new tests.

Misc

I have not exercised this against a live Cassandra cluster; the store's
existing unit tests patch Cluster so nothing connects, and the
testcontainers-based creator in tests/universal is not wired into
repo_configuration.py. The part that would most benefit from a maintainer's
eye on real hardware is the system_schema.tables query in
_drop_all_version_tables — happy to adjust it, or to drop that behaviour back
to SQLite's "current version only" if you would rather keep the six
implementations identical.

The second commit (docs:) is separable. docs/reference/alpha-feature-view-versioning.md
still said version-qualified reads were SQLite-only, which was already six
stores out of date before this branch; the list it now carries is taken from
OnlineStore._is_versioned_read_supported. Happy to drop that commit if you
would rather keep this PR to the Cassandra store alone.

Feature view versioning was added in feast-dev#6101 and implemented for SQLite only.
Every other online store raises VersionedOnlineReadNotSupported as soon as a
version-qualified reference reaches it, so a Feast deployment on Cassandra
could not use the feature at all.

Cassandra builds every table name in one place, _fq_table_name(), which is
used by the insert, select, create and drop paths alike. It now takes the
versioning flag and defers to compute_versioned_name(), the same helper
SQLite, MySQL and PostgreSQL reach through compute_table_id(), so each
version of a feature view is stored in a table of its own and an unversioned
deployment keeps exactly the names it has today.

Deleting a versioned view drops every version of it rather than only the
current one, following the MySQL and PostgreSQL implementations: the
in-memory feature view carries a single version, so dropping just that one
would leave the other tables orphaned in the keyspace.

CassandraOnlineStore is added to the list of stores that support versioned
reads.

Signed-off-by: Pavel Alekseev <alekceevpavel@mail.ru>
The versioning reference still said version-qualified reads were SQLite-only.
Seven stores support them now, so the page understated the feature by six
stores before this branch and by seven after it. The list is taken from
OnlineStore._is_versioned_read_supported, which is what actually decides.

Signed-off-by: Pavel Alekseev <alekceevpavel@mail.ru>
@alekseevpavel04
alekseevpavel04 requested review from a team as code owners August 20, 2026 20:55
@alekseevpavel04
alekseevpavel04 requested review from ejscribner, robhowley and tokoko and removed request for a team August 20, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add feature view versioning support to Cassandra online store

1 participant