File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed
physical-plan/src/joins/hash_join Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -237,16 +237,14 @@ pub fn check_subquery_expr(
237237 }
238238
239239 // For struct expressions, validate that the number of fields matches
240- if is_struct {
241- if let Expr :: ScalarFunction ( ref func) = * subquery. expr {
242- let num_tuple_cols = func. args . len ( ) ;
243- if num_tuple_cols != num_subquery_cols {
244- return plan_err ! (
245- "The number of columns in the tuple ({}) must match the number of columns in the subquery ({})" ,
246- num_tuple_cols,
247- num_subquery_cols
248- ) ;
249- }
240+ if is_struct && let Expr :: ScalarFunction ( ref func) = * subquery. expr {
241+ let num_tuple_cols = func. args . len ( ) ;
242+ if num_tuple_cols != num_subquery_cols {
243+ return plan_err ! (
244+ "The number of columns in the tuple ({}) must match the number of columns in the subquery ({})" ,
245+ num_tuple_cols,
246+ num_subquery_cols
247+ ) ;
250248 }
251249 }
252250 }
Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ fn build_join(
420420 let in_predicate = conditions
421421 . into_iter ( )
422422 . reduce ( |acc, cond| acc. and ( cond) )
423- . unwrap_or ( lit ( true ) ) ;
423+ . unwrap_or_else ( || lit ( true ) ) ;
424424
425425 in_predicate. and ( join_filter)
426426 } else {
@@ -481,7 +481,7 @@ fn build_join(
481481 conditions
482482 . into_iter ( )
483483 . reduce ( |acc, cond| acc. and ( cond) )
484- . unwrap_or ( lit ( true ) )
484+ . unwrap_or_else ( || lit ( true ) )
485485 } else {
486486 // Regular scalar function, handle as before
487487 let right_col = create_col_from_scalar_expr ( right. deref ( ) , alias) ?;
Original file line number Diff line number Diff line change @@ -544,12 +544,10 @@ impl HashJoinExec {
544544 check_join_is_valid ( & left_schema, & right_schema, & on) ?;
545545
546546 // Validate null_aware flag
547- if null_aware {
548- if !matches ! ( join_type, JoinType :: LeftAnti ) {
549- return plan_err ! (
550- "null_aware can only be true for LeftAnti joins, got {join_type}"
551- ) ;
552- }
547+ if null_aware && !matches ! ( join_type, JoinType :: LeftAnti ) {
548+ return plan_err ! (
549+ "null_aware can only be true for LeftAnti joins, got {join_type}"
550+ ) ;
553551 }
554552
555553 let ( join_schema, column_indices) =
You can’t perform that action at this time.
0 commit comments