@@ -22,6 +22,7 @@ use std::time::SystemTime;
2222
2323use common_base:: base:: Progress ;
2424use common_base:: runtime:: Runtime ;
25+ use common_catalog:: table_context:: SideloadOptions ;
2526use common_config:: Config ;
2627use common_datablocks:: DataBlock ;
2728use common_exception:: ErrorCode ;
@@ -78,6 +79,7 @@ pub struct QueryContextShared {
7879 pub ( in crate :: sessions) data_operator : DataOperator ,
7980 pub ( in crate :: sessions) executor : Arc < RwLock < Weak < PipelineExecutor > > > ,
8081 pub ( in crate :: sessions) precommit_blocks : Arc < RwLock < Vec < DataBlock > > > ,
82+ pub ( in crate :: sessions) sideload_config : Arc < RwLock < Option < SideloadOptions > > > ,
8183 pub ( in crate :: sessions) created_time : SystemTime ,
8284}
8385
@@ -107,6 +109,7 @@ impl QueryContextShared {
107109 affect : Arc :: new ( Mutex :: new ( None ) ) ,
108110 executor : Arc :: new ( RwLock :: new ( Weak :: new ( ) ) ) ,
109111 precommit_blocks : Arc :: new ( RwLock :: new ( vec ! [ ] ) ) ,
112+ sideload_config : Arc :: new ( RwLock :: new ( None ) ) ,
110113 created_time : SystemTime :: now ( ) ,
111114 } ) )
112115 }
@@ -316,6 +319,15 @@ impl QueryContextShared {
316319 swaped_precommit_blocks
317320 }
318321
322+ pub fn get_sideload ( & self ) -> Option < SideloadOptions > {
323+ self . sideload_config . read ( ) . clone ( )
324+ }
325+
326+ pub fn attach_sideload ( & self , sideload : SideloadOptions ) {
327+ let mut sideload_config = self . sideload_config . write ( ) ;
328+ * sideload_config = Some ( sideload) ;
329+ }
330+
319331 pub fn get_created_time ( & self ) -> SystemTime {
320332 self . created_time
321333 }
0 commit comments