File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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;
You can’t perform that action at this time.
0 commit comments