diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index 18729176dc..97fbbb1cb9 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -62,7 +62,7 @@ moka = { version = "0.12.10", features = ["future"] } murmur3 = { workspace = true } once_cell = { workspace = true } ordered-float = { workspace = true } -parquet = { workspace = true, features = ["async"] } +parquet = { workspace = true, features = ["async", "encryption"] } rand = { workspace = true } reqwest = { workspace = true } roaring = { workspace = true } diff --git a/crates/iceberg/src/arrow/reader/file_reader.rs b/crates/iceberg/src/arrow/reader/file_reader.rs index 79fbcc7960..63b7f06758 100644 --- a/crates/iceberg/src/arrow/reader/file_reader.rs +++ b/crates/iceberg/src/arrow/reader/file_reader.rs @@ -106,12 +106,16 @@ impl AsyncFileReader for ArrowFileReader { .boxed() } - // TODO: currently we don't respect `ArrowReaderOptions` cause it don't expose any method to access the option field - // we will fix it after `v55.1.0` is released in https://github.com/apache/arrow-rs/issues/7393 fn get_metadata( &mut self, - _options: Option<&'_ ArrowReaderOptions>, + options: Option<&'_ ArrowReaderOptions>, ) -> BoxFuture<'_, parquet::errors::Result>> { + let decryption_properties = options + .and_then(|opts| opts.file_decryption_properties()) + .cloned(); + + let metadata_options = options.map(|opts| opts.metadata_options().clone()); + async move { let reader = ParquetMetaDataReader::new() .with_prefetch_hint(self.parquet_read_options.metadata_size_hint()) @@ -124,7 +128,9 @@ impl AsyncFileReader for ArrowFileReader { )) .with_offset_index_policy(PageIndexPolicy::from( self.parquet_read_options.preload_offset_index(), - )); + )) + .with_metadata_options(metadata_options) + .with_decryption_properties(decryption_properties); let size = self.meta.size; let meta = reader.load_and_finish(self, size).await?;