Skip to content

Commit 7e5f060

Browse files
wgtmacgty404
andauthored
Update src/iceberg/table_scan.cc
Co-authored-by: Guotao Yu <guotao.yugt@gmail.com>
1 parent f2541ae commit 7e5f060

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/iceberg/table_scan.cc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,11 @@ TableScanBuilder& TableScanBuilder::UseRef(const std::string& ref) {
303303
"Cannot override ref, already set snapshot id={}",
304304
context_.snapshot_id.value());
305305
auto iter = metadata_->refs.find(ref);
306-
if (iter != metadata_->refs.end()) {
307-
ICEBERG_BUILDER_CHECK(iter->second != nullptr, "Ref {} is null", ref);
308-
int32_t snapshot_id = iter->second->snapshot_id;
309-
ICEBERG_BUILDER_ASSIGN_OR_RETURN(std::ignore, metadata_->SnapshotById(snapshot_id));
310-
context_.snapshot_id = snapshot_id;
311-
} else {
312-
return AddError(InvalidArgument("Cannot find ref {}", ref));
313-
}
306+
ICEBERG_BUILDER_CHECK(iter != metadata_->refs.end(), "Cannot find ref {}", ref);
307+
ICEBERG_BUILDER_CHECK(iter->second != nullptr, "Ref {} is null", ref);
308+
int32_t snapshot_id = iter->second->snapshot_id;
309+
ICEBERG_BUILDER_ASSIGN_OR_RETURN(std::ignore, metadata_->SnapshotById(snapshot_id));
310+
context_.snapshot_id = snapshot_id;
314311

315312
return *this;
316313
}

0 commit comments

Comments
 (0)