Skip to content

Commit

Permalink
More updates for VCF ingestion with tiledb URIs (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
gspowley authored Jul 31, 2024
1 parent 898deb8 commit 93d4056
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/tiledb/cloud/utilities/consolidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def consolidate_and_vacuum(
logger = get_logger()

with tiledb.scope_ctx(config):
# TODO: remove when remote fragment consolidation is supported
is_remote = array_uri.startswith("tiledb://")
if not is_remote and vacuum_fragments:
logger.info("Vacuuming fragments")
Expand Down
10 changes: 9 additions & 1 deletion src/tiledb/cloud/vcf/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,10 @@ def consolidate_dataset_udf(
group = tiledb.Group(dataset_uri)

for member in group:
# Skip non-array members
if member.type != tiledb.Array:
continue

uri = member.uri
name = member.name
is_remote = uri.startswith("tiledb://")
Expand All @@ -916,13 +920,15 @@ def consolidate_dataset_udf(
modes += ["fragments"]

for mode in modes:
logger.debug("Consolidating %r in %r (%s)", mode, uri, name)
config = tiledb.Config({"sm.consolidation.mode": mode})
try:
tiledb.consolidate(uri, config=config)
except Exception as e:
print(e)

for mode in modes:
logger.debug("Vacuuming %r in %r (%s)", mode, uri, name)
config = tiledb.Config({"sm.vacuum.mode": mode})
try:
tiledb.vacuum(uri, config=config)
Expand Down Expand Up @@ -1315,7 +1321,9 @@ def ingest_samples_dag(
consolidate.depends_on(ingest)

# Consolidate fragments in the stats arrays, if enabled
if consolidate_stats:
# TODO: remove when remote fragment consolidation is supported
is_remote = dataset_uri.startswith("tiledb://")
if consolidate_stats and not is_remote:

def group_member_uri(group_uri, group_member, config):
with tiledb.scope_ctx(config):
Expand Down

0 comments on commit 93d4056

Please sign in to comment.