1+ use crate :: operations:: encryption:: TableEncryption ;
12use crate :: table:: file_format_options:: {
23 FileFormatOptions , TableOptions , WriterPropertiesFactory , WriterPropertiesFactoryRef ,
34} ;
@@ -13,18 +14,13 @@ use std::fmt::{Debug, Formatter};
1314use std:: sync:: Arc ;
1415use uuid:: Uuid ;
1516
16- #[ cfg( feature = "datafusion" ) ]
17- use crate :: operations:: encryption:: TableEncryption ;
18-
1917// More advanced factory with KMS support
20- #[ cfg( feature = "datafusion" ) ]
2118#[ derive( Clone , Debug ) ]
2219pub struct KMSWriterPropertiesFactory {
2320 writer_properties : WriterProperties ,
2421 encryption : Option < crate :: operations:: encryption:: TableEncryption > ,
2522}
2623
27- #[ cfg( feature = "datafusion" ) ]
2824impl KMSWriterPropertiesFactory {
2925 pub fn with_encryption ( table_encryption : TableEncryption ) -> Self {
3026 let writer_properties = WriterProperties :: builder ( )
@@ -38,7 +34,6 @@ impl KMSWriterPropertiesFactory {
3834 }
3935}
4036
41- #[ cfg( feature = "datafusion" ) ]
4237#[ async_trait]
4338impl WriterPropertiesFactory for KMSWriterPropertiesFactory {
4439 fn compression ( & self , column_path : & ColumnPath ) -> Compression {
@@ -63,14 +58,12 @@ impl WriterPropertiesFactory for KMSWriterPropertiesFactory {
6358// -------------------------------------------------------------------------------------------------
6459// FileFormatOptions for KMS encryption based on settings in TableEncryption
6560// -------------------------------------------------------------------------------------------------
66- #[ cfg( feature = "datafusion" ) ]
6761pub struct KmsFileFormatOptions {
6862 table_encryption : TableEncryption ,
6963 writer_properties_factory : WriterPropertiesFactoryRef ,
7064 encryption_factory_id : String ,
7165}
7266
73- #[ cfg( feature = "datafusion" ) ]
7467impl KmsFileFormatOptions {
7568 pub fn new ( table_encryption : TableEncryption ) -> Self {
7669 let encryption_factory_id = format ! ( "delta-{}" , Uuid :: new_v4( ) ) ;
@@ -85,15 +78,13 @@ impl KmsFileFormatOptions {
8578 }
8679}
8780
88- #[ cfg( feature = "datafusion" ) ]
8981impl Debug for KmsFileFormatOptions {
9082 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
9183 f. debug_struct ( "KmsFileFormatOptions" )
9284 . finish_non_exhaustive ( )
9385 }
9486}
9587
96- #[ cfg( feature = "datafusion" ) ]
9788impl FileFormatOptions for KmsFileFormatOptions {
9889 fn table_options ( & self ) -> TableOptions {
9990 let mut table_options = TableOptions :: default ( ) ;
0 commit comments