aditya-subrahmanyan opened a new issue, #1697:
URL: https://github.com/apache/iceberg-rust/issues/1697

   ### Apache Iceberg Rust version
   
   0.5.1
   
   ### Describe the bug
   
   According to the [spec](https://iceberg.apache.org/spec/#version-2), the 
`sequence-number` field for a snapshot entry from v1 is optional/may not exist. 
When we try to read `metadata.json` that contains snapshots from both v1 and 
v2, the function fails with the following error if the v1 snapshot does not 
contain a `sequence-number`
   
   ```
   DataInvalid => Failed to parse json string, source: data did not match any 
variant of untagged enum TableMetadataEnum
   ```
   
   ### To Reproduce
   
   Using Iceberg Java SDK
   - Create table, explicitly setting format version to 1
   - Insert some rows into the table
   - Change format version to 2, this does not result in full rewrite of 
files/manifests
   - Add just one more row, creates file/manifest using version 2
   - Try reading the metadata in Rust, and it fails with the error
   
   ### Expected behavior
   
   Should we attempt to default the `sequence-number` to 0 (i.e. use 
`SnapshotV1`) to read such snapshot entries, if the `metadata.json` indicates 
that it belongs to v2?
   
   ### Willingness to contribute
   
   I would be willing to contribute a fix for this bug with guidance from the 
Iceberg community


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to