Skip to content

Commit

Permalink
Consider Current Domain
Browse files Browse the repository at this point in the history
  • Loading branch information
kounelisagis committed Feb 11, 2025
1 parent 99caf19 commit 748f266
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apis/python/src/tiledb/vector_search/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,20 @@ def read_source_metadata(
if source_type == "TILEDB_ARRAY":
schema = tiledb.ArraySchema.load(source_uri)
size = np.int64(schema.domain.dim(1).domain[1]) + 1
dimensions = np.int64(schema.domain.dim(0).domain[1]) + 1
# In the case that current domain is non-empty, we need to consider it
if hasattr(schema, "current_domain") and not schema.current_domain.is_empty:
dimensions = np.int64(schema.current_domain.dim(0).domain[1]) + 1
else:
dimensions = np.int64(schema.domain.dim(0).domain[1]) + 1
return size, dimensions, schema.attr(0).dtype
if source_type == "TILEDB_SPARSE_ARRAY":
schema = tiledb.ArraySchema.load(source_uri)
size = np.int64(schema.domain.dim(0).domain[1]) + 1
dimensions = np.int64(schema.domain.dim(1).domain[1]) + 1
# In the case that current domain is non-empty, we need to consider it
if hasattr(schema, "current_domain") and not schema.current_domain.is_empty:
dimensions = np.int64(schema.current_domain.dim(1).domain[1]) + 1
else:
dimensions = np.int64(schema.domain.dim(1).domain[1]) + 1
return size, dimensions, schema.attr(0).dtype
if source_type == "TILEDB_PARTITIONED_ARRAY":
with tiledb.open(source_uri, "r", config=config) as source_array:
Expand Down

0 comments on commit 748f266

Please sign in to comment.