Skip to content

Commit 82f0e62

Browse files
authored
Add the metadata group to the VCF dataset (#751)
1 parent 3262656 commit 82f0e62

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

libtiledbvcf/src/dataset/tiledbvcfdataset.cc

+12-3
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,11 @@ void TileDBVCFDataset::create_empty_metadata(
314314
create_group(ctx, metadata_group_uri(root_uri));
315315
create_sample_header_array(ctx, root_uri, checksum);
316316

317-
// Group assests use full paths for tiledb cloud, relative paths otherwise
317+
// Group assets use full paths for tiledb cloud, relative paths otherwise
318318
bool relative = !cloud_dataset(root_uri);
319319

320320
// Add arrays to the root group
321-
// We create the metadata group to maintain the existing directory structure,
322-
// but add the vcf_header array to the root group to simplify array opening.
321+
// We add the vcf_header array to the root group to simplify array opening.
323322
Group root_group(ctx, root_uri, TILEDB_WRITE);
324323
auto array_uri = vcf_headers_uri(root_uri, relative);
325324
LOG_DEBUG(
@@ -328,6 +327,16 @@ void TileDBVCFDataset::create_empty_metadata(
328327
array_uri,
329328
root_uri);
330329
root_group.add_member(array_uri, relative, VCF_HEADER_ARRAY);
330+
331+
// Add the metadata group to the root group, so it will be deleted when the
332+
// dataset is deleted.
333+
auto group_uri = metadata_group_uri(root_uri, relative);
334+
LOG_DEBUG(
335+
"Adding group name='{}' uri='{}' to group uri='{}'",
336+
METADATA_GROUP,
337+
group_uri,
338+
root_uri);
339+
root_group.add_member(group_uri, relative, METADATA_GROUP);
331340
}
332341

333342
void TileDBVCFDataset::create_empty_data_array(

0 commit comments

Comments
 (0)