Skip to content

Commit

Permalink
Sparse without dups unordered uses indexreader (#3347) (#3348)
Browse files Browse the repository at this point in the history
This fixes a mismatch between the serialization path and the query
strategy decision code that resulted in the serialization path
incorrectly trying to load the base reader state instead of the indexed
reader state.
  • Loading branch information
Shelnutt2 committed Jul 7, 2022
1 parent 78efc84 commit 7c5ee80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tiledb/sm/serialization/query.cc
Expand Up @@ -1271,8 +1271,9 @@ Status query_to_capnp(
}
} else if (
query.use_refactored_sparse_global_order_reader() && !schema.dense() &&
(layout == Layout::GLOBAL_ORDER ||
(layout == Layout::UNORDERED && query.subarray()->range_num() <= 1))) {
(query.condition() == nullptr || query.condition()->empty()) &&
(layout == Layout::GLOBAL_ORDER || layout == Layout::UNORDERED) &&
query.subarray()->range_num() <= 1) {
auto builder = query_builder->initReaderIndex();
auto reader = (SparseGlobalOrderReader*)query.strategy();

Expand Down Expand Up @@ -1801,7 +1802,7 @@ Status query_from_capnp(
// heterogeneous coordinate changes
if (type == QueryType::READ) {
if (query_reader.hasReaderIndex() && !schema.dense() &&
layout == Layout::GLOBAL_ORDER) {
(layout == Layout::GLOBAL_ORDER || layout == Layout::UNORDERED)) {
// Strategy needs to be cleared here to create the correct reader.
query->clear_strategy();
RETURN_NOT_OK(query->set_layout_unsafe(layout));
Expand Down

0 comments on commit 7c5ee80

Please sign in to comment.