diff --git a/libtiledbvcf/src/dataset/attribute_buffer_set.cc b/libtiledbvcf/src/dataset/attribute_buffer_set.cc index 9c07af1d9..7078235d9 100644 --- a/libtiledbvcf/src/dataset/attribute_buffer_set.cc +++ b/libtiledbvcf/src/dataset/attribute_buffer_set.cc @@ -335,177 +335,211 @@ void AttributeBufferSet::set_buffers( if (fixed_alloc_.empty()) { // Set all buffers if (version == TileDBVCFDataset::Version::V4) { - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V4::sample, - (uint64_t*)sample_name_.offsets().data(), - sample_name_.offsets().size(), sample_name_.data(), sample_name_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::DimensionNames::V4::sample, + (uint64_t*)sample_name_.offsets().data(), + sample_name_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V4::contig, - (uint64_t*)contig_.offsets().data(), - contig_.offsets().size(), contig_.data(), contig_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::DimensionNames::V4::contig, + (uint64_t*)contig_.offsets().data(), + contig_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V4::start_pos, start_pos_.data(), start_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::real_start_pos, real_start_pos_.data(), real_start_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::end_pos, end_pos_.data(), end_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::qual, qual_.data(), qual_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::alleles, - (uint64_t*)alleles_.offsets().data(), - alleles_.offsets().size(), alleles_.data(), alleles_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V4::alleles, + (uint64_t*)alleles_.offsets().data(), + alleles_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::id, - (uint64_t*)id_.offsets().data(), - id_.offsets().size(), id_.data(), id_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V4::id, + (uint64_t*)id_.offsets().data(), + id_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::filter_ids, - (uint64_t*)filter_ids_.offsets().data(), - filter_ids_.offsets().size(), filter_ids_.data(), filter_ids_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V4::filter_ids, + (uint64_t*)filter_ids_.offsets().data(), + filter_ids_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::info, - (uint64_t*)info_.offsets().data(), - info_.offsets().size(), info_.data(), info_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V4::info, + (uint64_t*)info_.offsets().data(), + info_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::fmt, - (uint64_t*)fmt_.offsets().data(), - fmt_.offsets().size(), fmt_.data(), fmt_.nelts()); + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V4::fmt, + (uint64_t*)fmt_.offsets().data(), + fmt_.offsets().size()); } else if (version == TileDBVCFDataset::Version::V3) { - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V3::sample, sample_.data(), sample_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V3::start_pos, start_pos_.data(), start_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::real_start_pos, real_start_pos_.data(), real_start_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::end_pos, end_pos_.data(), end_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::qual, qual_.data(), qual_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::alleles, - (uint64_t*)alleles_.offsets().data(), - alleles_.offsets().size(), alleles_.data(), alleles_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V3::alleles, + (uint64_t*)alleles_.offsets().data(), + alleles_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::id, - (uint64_t*)id_.offsets().data(), - id_.offsets().size(), id_.data(), id_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V3::id, + (uint64_t*)id_.offsets().data(), + id_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::filter_ids, - (uint64_t*)filter_ids_.offsets().data(), - filter_ids_.offsets().size(), filter_ids_.data(), filter_ids_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V3::filter_ids, + (uint64_t*)filter_ids_.offsets().data(), + filter_ids_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::info, - (uint64_t*)info_.offsets().data(), - info_.offsets().size(), info_.data(), info_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V3::info, + (uint64_t*)info_.offsets().data(), + info_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::fmt, - (uint64_t*)fmt_.offsets().data(), - fmt_.offsets().size(), fmt_.data(), fmt_.nelts()); + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V3::fmt, + (uint64_t*)fmt_.offsets().data(), + fmt_.offsets().size()); } else { assert(version == TileDBVCFDataset::Version::V2); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V2::sample, sample_.data(), sample_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V2::end_pos, end_pos_.data(), end_pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::pos, pos_.data(), pos_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::real_end, real_end_.data(), real_end_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::qual, qual_.data(), qual_.nelts()); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::alleles, - (uint64_t*)alleles_.offsets().data(), - alleles_.offsets().size(), alleles_.data(), alleles_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V2::alleles, + (uint64_t*)alleles_.offsets().data(), + alleles_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::id, - (uint64_t*)id_.offsets().data(), - id_.offsets().size(), id_.data(), id_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V2::id, + (uint64_t*)id_.offsets().data(), + id_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::filter_ids, - (uint64_t*)filter_ids_.offsets().data(), - filter_ids_.offsets().size(), filter_ids_.data(), filter_ids_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V2::filter_ids, + (uint64_t*)filter_ids_.offsets().data(), + filter_ids_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::info, - (uint64_t*)info_.offsets().data(), - info_.offsets().size(), info_.data(), info_.nelts()); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V2::info, + (uint64_t*)info_.offsets().data(), + info_.offsets().size()); + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::fmt, - (uint64_t*)fmt_.offsets().data(), - fmt_.offsets().size(), fmt_.data(), fmt_.nelts()); + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V2::fmt, + (uint64_t*)fmt_.offsets().data(), + fmt_.offsets().size()); } for (const auto& it : extra_attrs()) { - query->set_buffer( + query->set_data_buffer( + it.first, it.second.data(), it.second.nelts()); + query->set_offsets_buffer( it.first, (uint64_t*)it.second.offsets().data(), - it.second.offsets().size(), - it.second.data(), - it.second.nelts()); + it.second.offsets().size()); } } else { // For fixed-alloc, set only the allocated buffers. @@ -515,14 +549,12 @@ void AttributeBufferSet::set_buffers( Buffer* buff = std::get<2>(p); unsigned datatype_size = std::get<3>(p); if (var_num) { - query->set_buffer( - name, - (uint64_t*)buff->offsets().data(), - buff->offsets().size(), - buff->data(), - buff->size() / datatype_size); + query->set_data_buffer( + name, buff->data(), buff->size() / datatype_size); + query->set_offsets_buffer( + name, (uint64_t*)buff->offsets().data(), buff->offsets().size()); } else { - query->set_buffer( + query->set_data_buffer( name, buff->data(), buff->size() / datatype_size); } } @@ -534,163 +566,170 @@ void AttributeBufferSet::clear_query_buffers( if (fixed_alloc_.empty()) { // Clear all buffers by setting their size to 0. if (version == TileDBVCFDataset::Version::V4) { - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V4::sample, - (uint64_t*)sample_name_.offsets().data(), - 0, sample_name_.data(), 0); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::DimensionNames::V4::sample, + (uint64_t*)sample_name_.offsets().data(), + 0); + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V4::contig, - (uint64_t*)contig_.offsets().data(), - 0, contig_.data(), 0); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::DimensionNames::V4::contig, + (uint64_t*)contig_.offsets().data(), + 0); + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V4::start_pos, start_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::real_start_pos, real_start_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::end_pos, end_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::qual, qual_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V4::alleles, alleles_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V4::alleles, (uint64_t*)alleles_.offsets().data(), - 0, - alleles_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V4::id, id_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V4::id, (uint64_t*)id_.offsets().data(), - 0, - id_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V4::filter_ids, - (uint64_t*)filter_ids_.offsets().data(), - 0, filter_ids_.data(), 0); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V4::filter_ids, + (uint64_t*)filter_ids_.offsets().data(), + 0); + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V4::info, info_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V4::info, (uint64_t*)info_.offsets().data(), - 0, - info_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V4::fmt, fmt_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V4::fmt, (uint64_t*)fmt_.offsets().data(), - 0, - fmt_.data(), 0); } else if (version == TileDBVCFDataset::Version::V3) { - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V3::sample, sample_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V3::start_pos, start_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::real_start_pos, real_start_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::end_pos, end_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::qual, qual_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V3::alleles, alleles_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V3::alleles, (uint64_t*)alleles_.offsets().data(), - 0, - alleles_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V3::id, id_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V3::id, (uint64_t*)id_.offsets().data(), - 0, - id_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V3::filter_ids, - (uint64_t*)filter_ids_.offsets().data(), - 0, filter_ids_.data(), 0); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V3::filter_ids, + (uint64_t*)filter_ids_.offsets().data(), + 0); + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V3::info, info_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V3::info, (uint64_t*)info_.offsets().data(), - 0, - info_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V3::fmt, fmt_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V3::fmt, (uint64_t*)fmt_.offsets().data(), - 0, - fmt_.data(), 0); } else { assert(version == TileDBVCFDataset::Version::V2); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V2::sample, sample_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::DimensionNames::V2::end_pos, end_pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::pos, pos_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::real_end, real_end_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::qual, qual_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V2::alleles, alleles_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V2::alleles, (uint64_t*)alleles_.offsets().data(), - 0, - alleles_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V2::id, id_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V2::id, (uint64_t*)id_.offsets().data(), - 0, - id_.data(), 0); - query->set_buffer( + query->set_data_buffer( TileDBVCFDataset::AttrNames::V2::filter_ids, - (uint64_t*)filter_ids_.offsets().data(), - 0, filter_ids_.data(), 0); - query->set_buffer( + query->set_offsets_buffer( + TileDBVCFDataset::AttrNames::V2::filter_ids, + (uint64_t*)filter_ids_.offsets().data(), + 0); + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V2::info, info_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V2::info, (uint64_t*)info_.offsets().data(), - 0, - info_.data(), 0); - query->set_buffer( + query->set_data_buffer( + TileDBVCFDataset::AttrNames::V2::fmt, fmt_.data(), 0); + query->set_offsets_buffer( TileDBVCFDataset::AttrNames::V2::fmt, (uint64_t*)fmt_.offsets().data(), - 0, - fmt_.data(), 0); } for (const auto& it : extra_attrs()) { - query->set_buffer( - it.first, - (uint64_t*)it.second.offsets().data(), - 0, - it.second.data(), - 0); + query->set_data_buffer(it.first, it.second.data(), 0); + query->set_offsets_buffer( + it.first, (uint64_t*)it.second.offsets().data(), 0); } } else { // For fixed-alloc, set only the allocated buffers. @@ -699,10 +738,10 @@ void AttributeBufferSet::clear_query_buffers( const std::string& name = std::get<1>(p); Buffer* buff = std::get<2>(p); if (var_num) { - query->set_buffer( - name, (uint64_t*)buff->offsets().data(), 0, buff->data(), 0); + query->set_data_buffer(name, buff->data(), 0); + query->set_offsets_buffer(name, (uint64_t*)buff->offsets().data(), 0); } else { - query->set_buffer(name, buff->data(), 0); + query->set_data_buffer(name, buff->data(), 0); } } } diff --git a/libtiledbvcf/src/dataset/tiledbvcfdataset.cc b/libtiledbvcf/src/dataset/tiledbvcfdataset.cc index 0f0e77dc5..3ebdb34ee 100644 --- a/libtiledbvcf/src/dataset/tiledbvcfdataset.cc +++ b/libtiledbvcf/src/dataset/tiledbvcfdataset.cc @@ -1234,13 +1234,16 @@ std::unordered_map TileDBVCFDataset::fetch_vcf_headers( "Cannot fetch TileDB-VCF vcf headers; Array object unexpectedly null"); Query query(*ctx_, *vcf_header_array_); + Subarray subarray = + Subarray(vcf_header_array_->schema().context(), *vcf_header_array_); std::unordered_map sample_name_mapping; for (const auto& sample : samples) { sample_name_mapping[sample.sample_id] = sample.sample_name; - query.add_range(0, sample.sample_id, sample.sample_id); + subarray.add_range(0, sample.sample_id, sample.sample_id); } query.set_layout(TILEDB_ROW_MAJOR); + query.set_subarray(subarray); uint64_t header_offset_element = 0; uint64_t header_data_element = 0; diff --git a/libtiledbvcf/src/read/reader.cc b/libtiledbvcf/src/read/reader.cc index 08ea38447..af9dfc914 100644 --- a/libtiledbvcf/src/read/reader.cc +++ b/libtiledbvcf/src/read/reader.cc @@ -663,6 +663,8 @@ bool Reader::next_read_batch_v2_v3() { // Set up the TileDB query read_state_.query.reset(new Query(*ctx_, *read_state_.array)); + Subarray subarray = + Subarray(read_state_.array->schema().context(), *read_state_.array); set_tiledb_query_config(); // Set ranges @@ -671,7 +673,7 @@ bool Reader::next_read_batch_v2_v3() { debug_ranges << std::endl << "sample ids:" << std::endl; } for (const auto& sample : read_state_.current_sample_batches) { - read_state_.query->add_range(0, sample.sample_id, sample.sample_id); + subarray.add_range(0, sample.sample_id, sample.sample_id); if (params_.debug_params.print_tiledb_query_ranges && LOG_DEBUG_ENABLED()) { debug_ranges << "[" << sample.sample_id << ", " << sample.sample_id << "]" << std::endl; @@ -681,12 +683,13 @@ bool Reader::next_read_batch_v2_v3() { debug_ranges << std::endl << "regions:" << std::endl; } for (const auto& query_region : read_state_.query_regions) { - read_state_.query->add_range(1, query_region.col_min, query_region.col_max); + subarray.add_range(1, query_region.col_min, query_region.col_max); if (params_.debug_params.print_tiledb_query_ranges && LOG_DEBUG_ENABLED()) { debug_ranges << "[" << query_region.col_min << ", " << query_region.col_max << "]" << std::endl; } } + read_state_.query->set_subarray(subarray); read_state_.query->set_layout(TILEDB_UNORDERED); if (LOG_DEBUG_ENABLED()) { @@ -810,6 +813,8 @@ bool Reader::next_read_batch_v4() { // Set up the TileDB query read_state_.query.reset(new Query(*ctx_, *read_state_.array)); + Subarray subarray = + Subarray(read_state_.array->schema().context(), *read_state_.array); set_tiledb_query_config(); // Set ranges @@ -824,8 +829,7 @@ bool Reader::next_read_batch_v4() { if (params_.sample_partitioning.num_partitions == 1) { auto non_empty_domain = dataset_->data_array()->non_empty_domain_var( TileDBVCFDataset::DimensionNames::V4::sample); - read_state_.query->add_range( - 2, non_empty_domain.first, non_empty_domain.second); + subarray.add_range(2, non_empty_domain.first, non_empty_domain.second); if (params_.debug_params.print_tiledb_query_ranges && LOG_DEBUG_ENABLED()) { debug_ranges << "[" << non_empty_domain.first << ", " @@ -835,7 +839,7 @@ bool Reader::next_read_batch_v4() { // if we have all samples but are partitioning we need to only use the // first/last sample of the partition partitions are sorted both globally // and in the vector so this is a shortcut to have less ranges - read_state_.query->add_range( + subarray.add_range( 2, read_state_.current_sample_batches[0].sample_name, read_state_ @@ -857,7 +861,7 @@ bool Reader::next_read_batch_v4() { // If we are not exporting all samples add the current partition/batch's // list for (const auto& sample : read_state_.current_sample_batches) { - read_state_.query->add_range(2, sample.sample_name, sample.sample_name); + subarray.add_range(2, sample.sample_name, sample.sample_name); if (params_.debug_params.print_tiledb_query_ranges && LOG_DEBUG_ENABLED()) { debug_ranges << "[" << sample.sample_name << ", " << sample.sample_name @@ -872,7 +876,7 @@ bool Reader::next_read_batch_v4() { for (const auto& query_region : read_state_.query_regions_v4[read_state_.query_contig_batch_idx] .second) { - read_state_.query->add_range(1, query_region.col_min, query_region.col_max); + subarray.add_range(1, query_region.col_min, query_region.col_max); if (params_.debug_params.print_tiledb_query_ranges && LOG_DEBUG_ENABLED()) { debug_ranges << "[" << query_region.col_min << ", " << query_region.col_max << "]" << std::endl; @@ -885,7 +889,7 @@ bool Reader::next_read_batch_v4() { } } - read_state_.query->add_range( + subarray.add_range( 0, read_state_.query_regions_v4[read_state_.query_contig_batch_idx].first, read_state_.query_regions_v4[read_state_.query_contig_batch_idx].first); @@ -901,6 +905,7 @@ bool Reader::next_read_batch_v4() { .first << "]" << std::endl; } + read_state_.query->set_subarray(subarray); // Default export results are not sorted read_state_.query->set_layout(TILEDB_UNORDERED); diff --git a/libtiledbvcf/src/read/reader.h b/libtiledbvcf/src/read/reader.h index 12d01b584..6e9be6b7b 100644 --- a/libtiledbvcf/src/read/reader.h +++ b/libtiledbvcf/src/read/reader.h @@ -47,6 +47,7 @@ #include "read/read_query_results.h" #include "stats/allele_count.h" #include "stats/variant_stats_reader.h" +#include "tiledb/array_schema.h" namespace tiledb { namespace vcf { diff --git a/libtiledbvcf/src/utils/buffer.cc b/libtiledbvcf/src/utils/buffer.cc index c85143727..34c5b29c6 100644 --- a/libtiledbvcf/src/utils/buffer.cc +++ b/libtiledbvcf/src/utils/buffer.cc @@ -139,8 +139,8 @@ size_t Buffer::alloced_size() const { } void Buffer::set_query_buffer(const std::string& attr, tiledb::Query& q) { - q.set_buffer( - attr, offsets_.data(), offsets_.size(), (uint8_t*)data_, data_size_); + q.set_data_buffer(attr, (uint8_t*)data_, data_size_); + q.set_offsets_buffer(attr, offsets_.data(), offsets_.size()); } void Buffer::realloc(uint64_t new_alloced_size, bool clear_new) {