@@ -1918,6 +1918,43 @@ impl TableParquetOptions {
19181918 ..self
19191919 }
19201920 }
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+ }
19211958}
19221959
19231960impl ConfigField for TableParquetOptions {
@@ -2147,6 +2184,8 @@ impl ConfigField for ConfigFileEncryptionProperties {
21472184 let desc = "Metadata to use for the parquet footer" ;
21482185 self . footer_key_metadata_as_hex . visit ( v, key. as_str ( ) , desc) ;
21492186
2187+ self . column_encryption_properties . visit ( v, key_prefix, desc) ;
2188+
21502189 let key = format ! ( "{key_prefix}.aad_prefix_as_hex" ) ;
21512190 let desc = "AAD prefix to use" ;
21522191 self . aad_prefix_as_hex . visit ( v, key. as_str ( ) , desc) ;
@@ -2626,7 +2665,7 @@ impl Display for OutputFormat {
26262665mod tests {
26272666 use crate :: config:: {
26282667 ConfigEntry , ConfigExtension , ConfigField , ConfigFileType , ExtensionOptions ,
2629- Extensions , TableOptions ,
2668+ Extensions , TableOptions , TableParquetOptions ,
26302669 } ;
26312670 use std:: any:: Any ;
26322671 use std:: collections:: HashMap ;
@@ -2884,7 +2923,7 @@ mod tests {
28842923 #[ cfg( feature = "parquet_encryption" ) ]
28852924 #[ test]
28862925 fn parquet_encryption_factory_config ( ) {
2887- let mut parquet_options = crate :: config :: TableParquetOptions :: default ( ) ;
2926+ let mut parquet_options = TableParquetOptions :: default ( ) ;
28882927
28892928 assert_eq ! ( parquet_options. crypto. factory_id, None ) ;
28902929 assert_eq ! ( parquet_options. crypto. factory_options. options. len( ) , 0 ) ;
@@ -2925,6 +2964,23 @@ mod tests {
29252964 . any( |item| item. key == "format.bloom_filter_enabled::col1" ) )
29262965 }
29272966
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+
29282984 #[ cfg( feature = "parquet" ) ]
29292985 #[ test]
29302986 fn parquet_table_options_config_metadata_entry ( ) {
0 commit comments