diff --git a/tiledb/sm/query/writers/global_order_writer.cc b/tiledb/sm/query/writers/global_order_writer.cc index b0ed057c807a..36008a40f3cf 100644 --- a/tiledb/sm/query/writers/global_order_writer.cc +++ b/tiledb/sm/query/writers/global_order_writer.cc @@ -1525,6 +1525,7 @@ NDRange GlobalOrderWriter::ndranges_after_split( } uint64_t end = start_ + (rows_of_tiles_to_write * tile_extent) - 1; + // if there is a remainder it means we need one more row if (tiles_in_current_row_ != 0 && !reached_end_of_fragment && end < end_ && moved_row) { end++;