Skip to content

Commit

Permalink
make previous commit work for all datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisStaratzis committed Jul 23, 2024
1 parent 647f526 commit 73a7fda
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tiledb/sm/query/writers/global_order_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,7 @@ uint64_t GlobalOrderWriter::num_tiles_per_row(const Domain& domain) {
};

ret *= dim->domain_range(dim_dom) / apply_with_type(l, dim->type());
// todo consider cases where the above calculation has a remainder. Also
// consider other types
// todo consider cases where the above calculation has a remainder.
}
return ret;
}
Expand Down Expand Up @@ -1493,8 +1492,13 @@ NDRange GlobalOrderWriter::ndranges_after_split(uint64_t num) {
if (rows_written_ == 0) {
// It means that the start has not been set yet. Set it to the minimum value
// of the expanded domain for that dim
auto dim_dom_data = (const uint64_t*)dim_dom.data();
start_ = dim_dom_data[0];
auto ll = [&](auto T) {
auto dim_dom_data = (const decltype(T)*)dim_dom.data();
// todo this should be unsigned or signed
return static_cast<uint64_t>(dim_dom_data[0]);
};

start_ = apply_with_type(ll, dim->type());
}
uint64_t end = start_ + (rows_of_tiles_to_write * tile_extent) - 1;

Expand Down

0 comments on commit 73a7fda

Please sign in to comment.