diff --git a/crates/iceberg/public-api.txt b/crates/iceberg/public-api.txt index eb2d4f932b..19b5592590 100644 --- a/crates/iceberg/public-api.txt +++ b/crates/iceberg/public-api.txt @@ -2079,7 +2079,7 @@ pub fn iceberg::spec::ManifestWriterBuilder::build_v2_deletes(self) -> iceberg:: pub fn iceberg::spec::ManifestWriterBuilder::build_v3_data(self) -> iceberg::spec::ManifestWriter 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, key_metadata: core::option::Option>, 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, key_metadata: core::option::Option>, 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, schema: iceberg::spec::SchemaRef, partition_spec: iceberg::spec::PartitionSpec) -> iceberg::Result pub struct iceberg::spec::Map impl iceberg::spec::Map pub fn iceberg::spec::Map::get(&self, key: &iceberg::spec::Literal) -> core::option::Option<&core::option::Option> diff --git a/crates/iceberg/src/spec/manifest/writer.rs b/crates/iceberg/src/spec/manifest/writer.rs index 88da1a396c..ae6d6e0680 100644 --- a/crates/iceberg/src/spec/manifest/writer.rs +++ b/crates/iceberg/src/spec/manifest/writer.rs @@ -81,19 +81,19 @@ impl ManifestWriterBuilder { pub fn new_from_encrypted( encrypted_output: EncryptedOutputFile, snapshot_id: Option, - key_metadata: Option>, schema: SchemaRef, partition_spec: PartitionSpec, - ) -> Self { + ) -> Result { let location = encrypted_output.location().to_owned(); - Self { + let key_metadata = Some(encrypted_output.key_metadata().encode()?.to_vec()); + Ok(Self { writer_future: Box::pin(async move { encrypted_output.writer().await }), location, snapshot_id, key_metadata, schema, partition_spec, - } + }) } /// Build a [`ManifestWriter`] for format version 1. @@ -124,6 +124,7 @@ impl ManifestWriterBuilder { .format_version(FormatVersion::V2) .content(ManifestContentType::Data) .build(); + ManifestWriter::new( self.writer_future, self.location,