aarushigupta132 commented on code in PR #2701:
URL: https://github.com/apache/iceberg-rust/pull/2701#discussion_r3591621604


##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -85,19 +90,36 @@ impl ParquetWriterBuilder {
     /// Currently translates the content-defined-chunking keys
     /// (`write.parquet.content-defined-chunking.*`); other keys fall back to
     /// parquet-rs defaults.
-    pub fn from_table_properties(table_props: &TableProperties, schema: 
SchemaRef) -> Self {
+    ///
+    /// When `encryption.key-id` is set, records the DEK length.
+    pub fn from_table_properties(table_props: &TableProperties, schema: 
SchemaRef) -> Result<Self> {
         let cdc = table_props.cdc_enabled.then_some(CdcOptions {
             min_chunk_size: table_props.cdc_min_chunk_size,
             max_chunk_size: table_props.cdc_max_chunk_size,
             norm_level: table_props.cdc_norm_level,
         });
+
         // TODO: translate the remaining write.parquet.* keys (e.g. 
compression-codec,
         // row-group-size-bytes, page-size-bytes).
         // This constructor is intended to be the single place that maps them.
         let props = WriterProperties::builder()
             .set_content_defined_chunking(cdc)
             .build();
-        Self::new_with_match_mode(props, schema, FieldMatchMode::Id)
+
+        // NOTE: parquet-rs Modular Encryption currently only implements 
AES-128, so a
+        // `data-key-length` other than 16 is accepted here but fails at write.

Review Comment:
   should we have a stronger validation for this?



-- 
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