Skip to content

Commit

Permalink
code-review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Jan 9, 2025
1 parent 5643118 commit c97a166
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion tiledb/sm/array_schema/current_domain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ std::string CurrentDomain::as_string() const {
} else {
// As of 2025-01-09 there is no other such type. When/if we do make such a
// type, we'd need to configure it to return a description of itself.
return "CurrentDomain of non-NDRectangle type";
throw std::runtime_error(
"CurrentDomain::as_string of non-NDRectangle type is not implemented");
}
}

Expand Down
20 changes: 12 additions & 8 deletions tiledb/sm/query/query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#include "tiledb/sm/tile/writer_tile_tuple.h"

#include <cassert>
#include <format>
#include <iostream>
#include <sstream>

Expand Down Expand Up @@ -860,13 +859,18 @@ Status Query::process() {
// Make sure all ranges are contained in the current domain.
for (auto& range : subarray_.ranges_for_dim(d)) {
if (!cd->includes(d, range)) {
throw QueryException(std::format(
"A range {} on dimension '{}' was set outside of the current "
"domain {}.",
range_str(
range, array_schema_->domain().dimension_ptr(d)->type()),
array_schema_->domain().dimension_ptr(d)->name(),
cd->as_string()));
// No std::format:
// https://github.com/TileDB-Inc/TileDB/pull/5421#discussion_r1909405876
std::stringstream ss;
ss << "A range ";
ss << range_str(
range, array_schema_->domain().dimension_ptr(d)->type());
ss << " on dimension '";
ss << array_schema_->domain().dimension_ptr(d)->name();
ss << "' was set outside of the current domain ";
ss << cd->as_string();
ss << ".";
throw QueryException(ss.str());
}
}
} else if (!all_ned_contained_in_current_domain) {
Expand Down

0 comments on commit c97a166

Please sign in to comment.