Skip to content

refactor(encryption) use StandardKeyMetadata from EncryptedOutputFile in ManifestWriterBuilder#2628

Open
xanderbailey wants to merge 3 commits into
apache:mainfrom
xanderbailey:xb/refactor_manifest_list_writer_2
Open

refactor(encryption) use StandardKeyMetadata from EncryptedOutputFile in ManifestWriterBuilder#2628
xanderbailey wants to merge 3 commits into
apache:mainfrom
xanderbailey:xb/refactor_manifest_list_writer_2

Conversation

@xanderbailey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

In #2568 we introduced new_from_encrypted but the api isn't very ergonomic because EncryptedOutputFile has StandardKeyMetadata on it already so we don't need to pass in key_metadata also.

working towards #2034

What changes are included in this PR?

Are these changes tested?

pub fn iceberg::spec::ManifestWriterBuilder::build_v3_deletes(self) -> iceberg::spec::ManifestWriter
pub fn iceberg::spec::ManifestWriterBuilder::new(output: iceberg::io::OutputFile, snapshot_id: core::option::Option<i64>, key_metadata: core::option::Option<alloc::vec::Vec<u8>>, schema: iceberg::spec::SchemaRef, partition_spec: iceberg::spec::PartitionSpec) -> Self
pub fn iceberg::spec::ManifestWriterBuilder::new_from_encrypted(encrypted_output: iceberg::encryption::EncryptedOutputFile, snapshot_id: core::option::Option<i64>, key_metadata: core::option::Option<alloc::vec::Vec<u8>>, schema: iceberg::spec::SchemaRef, partition_spec: iceberg::spec::PartitionSpec) -> Self
pub fn iceberg::spec::ManifestWriterBuilder::new_from_encrypted(encrypted_output: iceberg::encryption::EncryptedOutputFile, snapshot_id: core::option::Option<i64>, schema: iceberg::spec::SchemaRef, partition_spec: iceberg::spec::PartitionSpec) -> iceberg::Result<Self>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a break to users since this hasn't been released or used within the crate

pub fn new(
output: OutputFile,
snapshot_id: Option<i64>,
key_metadata: Option<Vec<u8>>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise this at the time but it's likely incorrect that we have key_metadata in this constructor at all. This should never be present with a plaintext OutputFile. But in #2568 we discussed a desire to not break this API but on closer look, I think the current API here is error-prone.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blackmwk very interested to know your thoughts here.

@xanderbailey

Copy link
Copy Markdown
Contributor Author

failing CI is fixed in #2627

@xanderbailey xanderbailey force-pushed the xb/refactor_manifest_list_writer_2 branch from 584f31f to da189b6 Compare June 14, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant