Visitar URL original
feat: Add ScyllaDB online store with vector search by zseta · Pull Request #6508 · feast-dev/feast · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
Signed-off-by: Attila Toth <attila.toth@scylladb.com>
  • Loading branch information
zseta committed Jun 23, 2026
commit 496c174ffaf921399b9735ac5809cc78a4a6a30b
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# CQL templates
# ---------------------------------------------------------------------------


def _build_create_table_cql(fqtable: str, dim: Optional[int]) -> str:
"""Return a CREATE TABLE CQL string, optionally including the vector column.

Expand Down Expand Up @@ -352,7 +353,7 @@ def _get_session(self, config: RepoConfig) -> Session:
# Connect without a keyspace first so we can create it if needed.
session = self._cluster.connect()
session.execute(
f"CREATE KEYSPACE IF NOT EXISTS \"{keyspace}\""
f'CREATE KEYSPACE IF NOT EXISTS "{keyspace}"'
" WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': '3'};"
)
session.set_keyspace(keyspace)
Expand Down Expand Up @@ -724,7 +725,9 @@ def retrieve_online_documents_v2(
"dot": "DOT_PRODUCT",
}
candidate = distance_metric.upper()
sim_func = _METRIC_ALIASES.get(distance_metric, _METRIC_ALIASES.get(candidate, candidate))
sim_func = _METRIC_ALIASES.get(
distance_metric, _METRIC_ALIASES.get(candidate, candidate)
)

sim_expr_template = _SIM_FUNC_EXPR.get(sim_func)
if sim_expr_template is None:
Expand All @@ -749,7 +752,9 @@ def retrieve_online_documents_v2(
# 2. WHERE feature_name = ? → vec_feature
# 3. ORDER BY vector_value ANN OF ? → embedding
# 4. LIMIT ? → top_k
ann_rows = list(session.execute(ann_stmt, (embedding, vec_feature, embedding, top_k)))
ann_rows = list(
session.execute(ann_stmt, (embedding, vec_feature, embedding, top_k))
)

if not ann_rows:
return []
Expand Down
Loading