@@ -314,12 +314,11 @@ void TileDBVCFDataset::create_empty_metadata(
314
314
create_group (ctx, metadata_group_uri (root_uri));
315
315
create_sample_header_array (ctx, root_uri, checksum);
316
316
317
- // Group assests use full paths for tiledb cloud, relative paths otherwise
317
+ // Group assets use full paths for tiledb cloud, relative paths otherwise
318
318
bool relative = !cloud_dataset (root_uri);
319
319
320
320
// 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.
323
322
Group root_group (ctx, root_uri, TILEDB_WRITE);
324
323
auto array_uri = vcf_headers_uri (root_uri, relative);
325
324
LOG_DEBUG (
@@ -328,6 +327,16 @@ void TileDBVCFDataset::create_empty_metadata(
328
327
array_uri,
329
328
root_uri);
330
329
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);
331
340
}
332
341
333
342
void TileDBVCFDataset::create_empty_data_array (
0 commit comments