jdockerty opened a new issue, #919: URL: https://github.com/apache/iceberg-rust/issues/919
_This is partially a question and open discussion._ When building `TableMetadata` through the `TableMetadataBuilder`, all options of building "from scratch" force a reassignment of field IDs: - Using [`TableMetadataBuilder::new`](https://docs.rs/iceberg/latest/src/iceberg/spec/table_metadata_builder.rs.html#87-89) - Using [`TableMetadataBuilder::from_table_creation`](https://docs.rs/iceberg/latest/src/iceberg/spec/table_metadata_builder.rs.html#184-185), as this is a wrapper over `TableMetadataBuilder::new` using the `TableCreation` struct. I noticed that it would be possible to get any type of `TableMetadata` that was desired through using the object directly, _but_ all of the fields are restricted to [`pub(crate)` scope](https://docs.rs/iceberg/latest/src/iceberg/spec/table_metadata.rs.html#106-174). I suspect the reason for this is safety, i.e. ensuring that creation occurs through the builder pattern where the relevant checks are performed on call to `build()`. **Would it be problematic to lift the restriction on the `TableMetadata` fields to be `pub`[^1] or allow the creation of `TableMetadata` without reassigning field IDs?** [^1]: Considering this conflicts with the native Java implementation, I would also suspect it is problematic to do in the Rust version. --- For extra context, we're currently constructing Iceberg metadata around pre-existing parquet files written by another system; however, there is no Iceberg catalog or prior metadata JSON. I noticed there is also a [`StaticTable`](https://docs.rs/iceberg/latest/iceberg/table/struct.StaticTable.html); however, this requires either pre-existing JSON from FileIO or an input `TableMetadata`, this 2nd option brings us back to the above issue. -- 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]
