@@ -52,7 +52,7 @@ pub struct InnerHashJoin {
5252 pub ( crate ) function_ctx : FunctionContext ,
5353 pub ( crate ) basic_state : Arc < BasicHashJoinState > ,
5454 pub ( crate ) performance_context : PerformanceContext ,
55- nested_loop_filter : Option < FilterExecutor > ,
55+ nested_loop_filter : FilterExecutor ,
5656}
5757
5858impl InnerHashJoin {
@@ -84,7 +84,7 @@ impl InnerHashJoin {
8484 function_ctx,
8585 basic_state : state,
8686 performance_context : context,
87- nested_loop_filter : Some ( nested_loop_filter ) ,
87+ nested_loop_filter,
8888 } )
8989 }
9090}
@@ -127,12 +127,10 @@ impl Join for InnerHashJoin {
127127 }
128128 HashJoinHashTable :: NestedLoop ( build_blocks) => {
129129 let nested = Box :: new ( LoopJoinStream :: new ( data, build_blocks) ) ;
130- return match self . nested_loop_filter . as_mut ( ) {
131- Some ( filter_executor) => {
132- Ok ( InnerHashJoinFilterStream :: create ( nested, filter_executor) )
133- }
134- None => Ok ( nested) ,
135- } ;
130+ return Ok ( InnerHashJoinFilterStream :: create (
131+ nested,
132+ & mut self . nested_loop_filter ,
133+ ) ) ;
136134 }
137135 _ => ( ) ,
138136 }
@@ -146,7 +144,7 @@ impl Join for InnerHashJoin {
146144 } ;
147145
148146 self . desc . remove_keys_nullable ( & mut keys) ;
149- let probe_block = data. project ( & self . desc . probe_projections ) ;
147+ let probe_block = data. project ( & self . desc . probe_projection ) ;
150148
151149 let joined_stream = with_join_hash_method ! ( |T | match self . basic_state. hash_table. deref( ) {
152150 HashJoinHashTable :: T ( table) => {
@@ -252,31 +250,27 @@ impl<'a> JoinStream for InnerHashJoinStream<'a> {
252250 ( None , None ) => DataBlock :: new ( vec ! [ ] , self . probed_rows . matched_build . len ( ) ) ,
253251 } ;
254252
255- if !self . desc . probe_to_build . is_empty ( ) {
256- for ( index, ( is_probe_nullable, is_build_nullable) ) in
257- self . desc . probe_to_build . iter ( )
258- {
259- let entry = match ( is_probe_nullable, is_build_nullable) {
260- ( true , true ) | ( false , false ) => result_block. get_by_offset ( * index) . clone ( ) ,
261- ( true , false ) => {
262- result_block. get_by_offset ( * index) . clone ( ) . remove_nullable ( )
263- }
264- ( false , true ) => {
265- let entry = result_block. get_by_offset ( * index) ;
266- let col = entry. to_column ( ) ;
267-
268- match col. is_null ( ) || col. is_nullable ( ) {
269- true => entry. clone ( ) ,
270- false => BlockEntry :: from ( NullableColumn :: new_column (
271- col,
272- Bitmap :: new_constant ( true , result_block. num_rows ( ) ) ,
273- ) ) ,
274- }
253+ for ( index, ( is_probe_nullable, is_build_nullable) ) in
254+ self . desc . probe_to_build . iter ( ) . cloned ( )
255+ {
256+ let entry = match ( is_probe_nullable, is_build_nullable) {
257+ ( true , true ) | ( false , false ) => result_block. get_by_offset ( index) . clone ( ) ,
258+ ( true , false ) => result_block. get_by_offset ( index) . clone ( ) . remove_nullable ( ) ,
259+ ( false , true ) => {
260+ let entry = result_block. get_by_offset ( index) ;
261+ let col = entry. to_column ( ) ;
262+
263+ match col. is_null ( ) || col. is_nullable ( ) {
264+ true => entry. clone ( ) ,
265+ false => BlockEntry :: from ( NullableColumn :: new_column (
266+ col,
267+ Bitmap :: new_constant ( true , result_block. num_rows ( ) ) ,
268+ ) ) ,
275269 }
276- } ;
270+ }
271+ } ;
277272
278- result_block. add_entry ( entry) ;
279- }
273+ result_block. add_entry ( entry) ;
280274 }
281275
282276 return Ok ( Some ( result_block) ) ;
0 commit comments