Skip to content

Commit 3fe8adc

Browse files
committed
fix ci
1 parent 8de07c9 commit 3fe8adc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/iceberg/table_scan.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919

2020
#include "iceberg/table_scan.h"
2121

22+
#include <cstdint>
2223
#include <cstring>
2324
#include <iterator>
25+
#include <utility>
2426

2527
#include "iceberg/expression/binder.h"
2628
#include "iceberg/expression/expression.h"
@@ -814,8 +816,12 @@ IncrementalChangelogScan::PlanFiles(std::optional<int64_t> from_snapshot_id_excl
814816
std::unordered_set<int64_t> snapshot_ids;
815817
std::unordered_map<int64_t, int32_t> snapshot_ordinals;
816818
for (const auto& snapshot : changelog_snapshots) {
819+
ICEBERG_PRECHECK(
820+
std::cmp_less_equal(snapshot_ids.size(), std::numeric_limits<int32_t>::max()),
821+
"Number of snapshots in changelog scan exceeds maximum supported");
817822
snapshot_ids.insert(snapshot.first->snapshot_id);
818-
snapshot_ordinals.try_emplace(snapshot.first->snapshot_id, snapshot_ordinals.size());
823+
snapshot_ordinals.try_emplace(snapshot.first->snapshot_id,
824+
static_cast<int32_t>(snapshot_ordinals.size()));
819825
}
820826

821827
std::vector<ManifestFile> data_manifests;

0 commit comments

Comments
 (0)