@@ -455,13 +455,13 @@ fn collect_and_predicates(
455455 }
456456
457457 // Handle BinaryExpr with AND operator
458- if let Some ( binary) = expr. as_any ( ) . downcast_ref :: < BinaryExpr > ( ) {
459- if matches ! ( binary. op( ) , Operator :: And ) {
460- // Recursively collect AND sub-conditions from both sides
461- collect_and_predicates ( binary . left ( ) , schema , predicates ) ;
462- collect_and_predicates ( binary. right ( ) , schema, predicates) ;
463- return ;
464- }
458+ if let Some ( binary) = expr. as_any ( ) . downcast_ref :: < BinaryExpr > ( )
459+ && matches ! ( binary. op( ) , Operator :: And )
460+ {
461+ // Recursively collect AND sub-conditions from both sides
462+ collect_and_predicates ( binary. left ( ) , schema, predicates) ;
463+ collect_and_predicates ( binary . right ( ) , schema , predicates ) ;
464+ return ;
465465 }
466466
467467 // Not an AND expression, convert the whole expression
@@ -487,13 +487,13 @@ fn collect_or_predicates(
487487 }
488488
489489 // Handle BinaryExpr with OR operator
490- if let Some ( binary) = expr. as_any ( ) . downcast_ref :: < BinaryExpr > ( ) {
491- if matches ! ( binary. op( ) , Operator :: Or ) {
492- // Recursively collect OR sub-conditions from both sides
493- collect_or_predicates ( binary . left ( ) , schema , predicates ) ;
494- collect_or_predicates ( binary. right ( ) , schema, predicates) ;
495- return ;
496- }
490+ if let Some ( binary) = expr. as_any ( ) . downcast_ref :: < BinaryExpr > ( )
491+ && matches ! ( binary. op( ) , Operator :: Or )
492+ {
493+ // Recursively collect OR sub-conditions from both sides
494+ collect_or_predicates ( binary. left ( ) , schema, predicates) ;
495+ collect_or_predicates ( binary . right ( ) , schema , predicates ) ;
496+ return ;
497497 }
498498
499499 // Not an OR expression, convert the whole expression
@@ -667,10 +667,10 @@ fn convert_expr_to_orc_internal(
667667 // Convert IN to multiple OR conditions: col = val1 OR col = val2 OR ...
668668 let mut predicates = Vec :: new ( ) ;
669669 for list_expr in in_list. list ( ) {
670- if let Some ( lit) = list_expr. as_any ( ) . downcast_ref :: < Literal > ( ) {
671- if let Some ( pred_value) = convert_scalar_value ( lit. value ( ) ) {
672- predicates . push ( Predicate :: eq ( col_name , pred_value ) ) ;
673- }
670+ if let Some ( lit) = list_expr. as_any ( ) . downcast_ref :: < Literal > ( )
671+ && let Some ( pred_value) = convert_scalar_value ( lit. value ( ) )
672+ {
673+ predicates . push ( Predicate :: eq ( col_name , pred_value ) ) ;
674674 }
675675 }
676676
@@ -699,20 +699,20 @@ fn convert_expr_to_orc_internal(
699699 return None ;
700700 }
701701
702- if let Some ( col) = left. as_any ( ) . downcast_ref :: < Column > ( ) {
703- if let Some ( lit) = right. as_any ( ) . downcast_ref :: < Literal > ( ) {
704- let col_name = col . name ( ) ;
705- let value = lit . value ( ) ;
706- return build_comparison_predicate ( col_name , op , value) ;
707- }
702+ if let Some ( col) = left. as_any ( ) . downcast_ref :: < Column > ( )
703+ && let Some ( lit) = right. as_any ( ) . downcast_ref :: < Literal > ( )
704+ {
705+ let col_name = col . name ( ) ;
706+ let value = lit . value ( ) ;
707+ return build_comparison_predicate ( col_name , op , value ) ;
708708 }
709709
710- if let Some ( lit) = left. as_any ( ) . downcast_ref :: < Literal > ( ) {
711- if let Some ( col) = right. as_any ( ) . downcast_ref :: < Column > ( ) {
712- let col_name = col . name ( ) ;
713- let value = lit . value ( ) ;
714- return build_comparison_predicate_reversed ( col_name , op , value) ;
715- }
710+ if let Some ( lit) = left. as_any ( ) . downcast_ref :: < Literal > ( )
711+ && let Some ( col) = right. as_any ( ) . downcast_ref :: < Column > ( )
712+ {
713+ let col_name = col . name ( ) ;
714+ let value = lit . value ( ) ;
715+ return build_comparison_predicate_reversed ( col_name , op , value ) ;
716716 }
717717 }
718718
0 commit comments