Skip to content

Commit

Permalink
clean up add_range API update
Browse files Browse the repository at this point in the history
  • Loading branch information
awenocur committed Aug 5, 2024
1 parent f4ed381 commit 91806bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
3 changes: 1 addition & 2 deletions libtiledbvcf/src/dataset/tiledbvcfdataset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,7 @@ std::unordered_map<uint32_t, SafeBCFHdr> TileDBVCFDataset::fetch_vcf_headers(
"Cannot fetch TileDB-VCF vcf headers; Array object unexpectedly null");

Query query(*ctx_, *vcf_header_array_);
ArraySchema schema = vcf_header_array_->schema();
Subarray subarray = Subarray(schema.context(), *vcf_header_array_);
Subarray subarray = Subarray(vcf_header_array_->schema().context(), *vcf_header_array_);

std::unordered_map<uint32_t, std::string> sample_name_mapping;
for (const auto& sample : samples) {
Expand Down
16 changes: 3 additions & 13 deletions libtiledbvcf/src/read/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,8 @@ bool Reader::next_read_batch_v2_v3() {

// Set up the TileDB query
read_state_.query.reset(new Query(*ctx_, *read_state_.array));
{
std::shared_ptr<ArraySchema> new_schema =
std::make_shared<ArraySchema>(read_state_.array->schema());
read_state_.schema.swap(new_schema);
}
Subarray subarray =
Subarray(read_state_.schema->context(), *read_state_.array);
Subarray subarray =
Subarray(read_state_.array->schema().context(), *read_state_.array);
set_tiledb_query_config();

// Set ranges
Expand Down Expand Up @@ -818,13 +813,8 @@ bool Reader::next_read_batch_v4() {

// Set up the TileDB query
read_state_.query.reset(new Query(*ctx_, *read_state_.array));
{
std::shared_ptr<ArraySchema> new_schema =
std::make_shared<ArraySchema>(read_state_.array->schema());
read_state_.schema.swap(new_schema);
}
Subarray subarray =
Subarray(read_state_.schema->context(), *read_state_.array);
Subarray(read_state_.array->schema().context(), *read_state_.array);
set_tiledb_query_config();

// Set ranges
Expand Down
1 change: 0 additions & 1 deletion libtiledbvcf/src/read/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ class Reader {

/** TileDB query object. */
std::unique_ptr<Query> query;
std::shared_ptr<ArraySchema> schema;

/** Struct containing query results from last TileDB query. */
ReadQueryResults query_results;
Expand Down

0 comments on commit 91806bc

Please sign in to comment.