Skip to content

Commit

Permalink
Disable consolidate_update_fragments for TileDB Cloud URIs (#536)
Browse files Browse the repository at this point in the history
Disable `_consolidate_update_fragments` for TileDB Cloud URIs.

Fragment consolidation is not supported in TileDB Cloud.
  • Loading branch information
NikolaosPapailiou authored Oct 2, 2024
1 parent c3e2400 commit 3b95816
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis/python/src/tiledb/vector_search/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os
import time
import warnings
from abc import ABCMeta
from abc import abstractmethod
from typing import Any, Mapping, Optional
Expand Down Expand Up @@ -800,6 +801,17 @@ def _set_has_updates(self, has_updates: bool = True):
self.group = tiledb.Group(self.uri, "r", ctx=tiledb.Ctx(self.config))

def _consolidate_update_fragments(self):
# Disable update fragment consolidation for TileDB Cloud URIs
# as this is not supported.
if self.uri.startswith("tiledb://"):
warnings.warn(
"Update fragment consolidation is not supported for `tiledb://` URIs. "
"Executing multiple updates without consolidating the update fragments can "
"result in poor search performance. Please make sure that you periodically "
"execute `_consolidate_update_fragments` using the storage filesystem URI.",
stacklevel=2,
)
return
with tiledb.scope_ctx(ctx_or_config=self.config):
fragments_info = tiledb.array_fragments(self.updates_array_uri)
count_fragments = 0
Expand Down

0 comments on commit 3b95816

Please sign in to comment.