Skip to content

Commit f24e071

Browse files
make previous commit work for all datatypes
1 parent 3129b29 commit f24e071

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tiledb/sm/query/writers/global_order_writer.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,8 +1448,7 @@ uint64_t GlobalOrderWriter::num_tiles_per_row(const Domain& domain) {
14481448
};
14491449

14501450
ret *= dim->domain_range(dim_dom) / apply_with_type(l, dim->type());
1451-
// todo consider cases where the above calculation has a remainder. Also
1452-
// consider other types
1451+
// todo consider cases where the above calculation has a remainder.
14531452
}
14541453
return ret;
14551454
}
@@ -1492,8 +1491,13 @@ NDRange GlobalOrderWriter::ndranges_after_split(uint64_t num) {
14921491
if (rows_written_ == 0) {
14931492
// It means that the start has not been set yet. Set it to the minimum value
14941493
// of the expanded domain for that dim
1495-
auto dim_dom_data = (const uint64_t*)dim_dom.data();
1496-
start_ = dim_dom_data[0];
1494+
auto ll = [&](auto T) {
1495+
auto dim_dom_data = (const decltype(T)*)dim_dom.data();
1496+
// todo this should be unsigned or signed
1497+
return static_cast<uint64_t>(dim_dom_data[0]);
1498+
};
1499+
1500+
start_ = apply_with_type(ll, dim->type());
14971501
}
14981502
uint64_t end = start_ + (rows_of_tiles_to_write * tile_extent) - 1;
14991503

0 commit comments

Comments
 (0)