Skip to content

Commit

Permalink
Handle query condition causing incomplete query (#2659)
Browse files Browse the repository at this point in the history
If the query has a condition that filters out a tile, the tile needs to
be removed from the query. The bug is when the tile remains but all
cells have been filtered the query results in incomplete state since a
tile remains but each submit skips the tile (since cell num is 0).

Co-authored-by: Luc Rancourt <luc.rancourt@tiledb.com>
  • Loading branch information
Shelnutt2 and KiterLuc committed Nov 24, 2021
1 parent f4a3d45 commit be44b49
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tiledb/sm/query/sparse_unordered_with_dups_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,15 @@ Status SparseUnorderedWithDupsReader::end_iteration() {
RETURN_NOT_OK(remove_result_tile(last_f, result_tiles_.begin()));
}

// Patch: if we have a query condition set, we might not clean up some reault
// tiles properly, clean them up here.
if (!condition_.empty() && read_state_.result_cell_slabs_.empty()) {
while (!result_tiles_.empty()) {
auto f = result_tiles_.begin()->frag_idx();
RETURN_NOT_OK(remove_result_tile(f, result_tiles_.begin()));
}
}

auto uint64_t_max = std::numeric_limits<uint64_t>::max();
copy_end_ = std::pair<uint64_t, uint64_t>(uint64_t_max, uint64_t_max);

Expand Down

0 comments on commit be44b49

Please sign in to comment.