Skip to content

Commit

Permalink
improved error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Jan 21, 2025
1 parent 744e131 commit e39ce8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/from_substrait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ shared_ptr<Relation> SubstraitToDuckDB::TransformReadOp(const substrait::Rel &so
if (sget.iceberg_table().direct().has_snapshot_id()) {
auto str = sget.iceberg_table().direct().snapshot_id();
int64_t snapshot_id = strtoimax(str.c_str(), nullptr, 10);
if (snapshot_id == 0) {
if (snapshot_id <= 0 || snapshot_id == std::numeric_limits<int64_t>::max()) {
throw InvalidInputException("Invalid snapshot id: " + sget.iceberg_table().direct().snapshot_id());
}
parameters.push_back(Value::UBIGINT(snapshot_id));
Expand Down

0 comments on commit e39ce8a

Please sign in to comment.