@@ -1918,6 +1918,43 @@ impl TableParquetOptions {
1918
1918
..self
1919
1919
}
1920
1920
}
1921
+
1922
+ /// Retrieves all configuration entries from this `TableParquetOptions`.
1923
+ ///
1924
+ /// # Returns
1925
+ ///
1926
+ /// A vector of `ConfigEntry` instances, representing all the configuration options within this
1927
+ pub fn entries ( self : & TableParquetOptions ) -> Vec < ConfigEntry > {
1928
+ struct Visitor ( Vec < ConfigEntry > ) ;
1929
+
1930
+ impl Visit for Visitor {
1931
+ fn some < V : Display > (
1932
+ & mut self ,
1933
+ key : & str ,
1934
+ value : V ,
1935
+ description : & ' static str ,
1936
+ ) {
1937
+ self . 0 . push ( ConfigEntry {
1938
+ key : key[ 1 ..] . to_string ( ) ,
1939
+ value : Some ( value. to_string ( ) ) ,
1940
+ description,
1941
+ } )
1942
+ }
1943
+
1944
+ fn none ( & mut self , key : & str , description : & ' static str ) {
1945
+ self . 0 . push ( ConfigEntry {
1946
+ key : key[ 1 ..] . to_string ( ) ,
1947
+ value : None ,
1948
+ description,
1949
+ } )
1950
+ }
1951
+ }
1952
+
1953
+ let mut v = Visitor ( vec ! [ ] ) ;
1954
+ self . visit ( & mut v, "" , "" ) ;
1955
+
1956
+ v. 0
1957
+ }
1921
1958
}
1922
1959
1923
1960
impl ConfigField for TableParquetOptions {
@@ -2147,6 +2184,8 @@ impl ConfigField for ConfigFileEncryptionProperties {
2147
2184
let desc = "Metadata to use for the parquet footer" ;
2148
2185
self . footer_key_metadata_as_hex . visit ( v, key. as_str ( ) , desc) ;
2149
2186
2187
+ self . column_encryption_properties . visit ( v, key_prefix, desc) ;
2188
+
2150
2189
let key = format ! ( "{key_prefix}.aad_prefix_as_hex" ) ;
2151
2190
let desc = "AAD prefix to use" ;
2152
2191
self . aad_prefix_as_hex . visit ( v, key. as_str ( ) , desc) ;
@@ -2626,7 +2665,7 @@ impl Display for OutputFormat {
2626
2665
mod tests {
2627
2666
use crate :: config:: {
2628
2667
ConfigEntry , ConfigExtension , ConfigField , ConfigFileType , ExtensionOptions ,
2629
- Extensions , TableOptions ,
2668
+ Extensions , TableOptions , TableParquetOptions ,
2630
2669
} ;
2631
2670
use std:: any:: Any ;
2632
2671
use std:: collections:: HashMap ;
@@ -2884,7 +2923,7 @@ mod tests {
2884
2923
#[ cfg( feature = "parquet_encryption" ) ]
2885
2924
#[ test]
2886
2925
fn parquet_encryption_factory_config ( ) {
2887
- let mut parquet_options = crate :: config :: TableParquetOptions :: default ( ) ;
2926
+ let mut parquet_options = TableParquetOptions :: default ( ) ;
2888
2927
2889
2928
assert_eq ! ( parquet_options. crypto. factory_id, None ) ;
2890
2929
assert_eq ! ( parquet_options. crypto. factory_options. options. len( ) , 0 ) ;
@@ -2925,6 +2964,23 @@ mod tests {
2925
2964
. any( |item| item. key == "format.bloom_filter_enabled::col1" ) )
2926
2965
}
2927
2966
2967
+ #[ cfg( feature = "parquet" ) ]
2968
+ #[ test]
2969
+ fn parquet_table_parquet_options_config_entry ( ) {
2970
+ let mut table_parquet_options = TableParquetOptions :: new ( ) ;
2971
+ table_parquet_options
2972
+ . set (
2973
+ "crypto.file_encryption.column_key_as_hex::double_field" ,
2974
+ "31323334353637383930313233343530" ,
2975
+ )
2976
+ . unwrap ( ) ;
2977
+ let entries = table_parquet_options. entries ( ) ;
2978
+ assert ! ( entries
2979
+ . iter( )
2980
+ . any( |item| item. key
2981
+ == "crypto.file_encryption.column_key_as_hex::double_field" ) )
2982
+ }
2983
+
2928
2984
#[ cfg( feature = "parquet" ) ]
2929
2985
#[ test]
2930
2986
fn parquet_table_options_config_metadata_entry ( ) {
0 commit comments