JanKaul / iceberg-rust

Rust implementation of Apache Iceberg with integration for Datafusion
Apache License 2.0
106 stars 14 forks source link

Avoid negative snaphot ids #38

Closed rdettai closed 1 month ago

rdettai commented 1 month ago

As the snapshot id is part of the manifest list name, having a negative value gives weird file names:

snap--199151010591443303127a4577f-b6fa-49ff-bee4-8d96ad643ac6.avro

I assume interpreting the random bytes as u64 was intended to ensure that the value is positive, but the cast to i64 can overflow so some values end up being negative.

JanKaul commented 1 month ago

Thanks for catching and fixing that issue.