@@ -232,7 +232,6 @@ async fn test_join_with_swap() {
232232 . unwrap ( ) ;
233233
234234 let swapping_projection = optimized_join
235- . as_ref ( )
236235 . downcast_ref :: < ProjectionExec > ( )
237236 . expect ( "A proj is required to swap columns back to their original order" ) ;
238237
@@ -246,7 +245,6 @@ async fn test_join_with_swap() {
246245
247246 let swapped_join = swapping_projection
248247 . input ( )
249- . as_ref ( )
250248 . downcast_ref :: < HashJoinExec > ( )
251249 . expect ( "The type of the plan should not be changed" ) ;
252250
@@ -295,7 +293,6 @@ async fn test_left_join_no_swap() {
295293 . unwrap ( ) ;
296294
297295 let swapped_join = optimized_join
298- . as_ref ( )
299296 . downcast_ref :: < HashJoinExec > ( )
300297 . expect ( "The type of the plan should not be changed" ) ;
301298
@@ -345,12 +342,9 @@ async fn test_join_with_swap_semi() {
345342 . optimize ( Arc :: new ( join) , & ConfigOptions :: new ( ) )
346343 . unwrap ( ) ;
347344
348- let swapped_join = optimized_join
349- . as_ref ( )
350- . downcast_ref :: < HashJoinExec > ( )
351- . expect (
352- "A proj is not required to swap columns back to their original order" ,
353- ) ;
345+ let swapped_join = optimized_join. downcast_ref :: < HashJoinExec > ( ) . expect (
346+ "A proj is not required to swap columns back to their original order" ,
347+ ) ;
354348
355349 assert_eq ! ( swapped_join. schema( ) . fields( ) . len( ) , 1 ) ;
356350 assert_eq ! (
@@ -401,12 +395,9 @@ async fn test_join_with_swap_mark() {
401395 . optimize ( Arc :: new ( join) , & ConfigOptions :: new ( ) )
402396 . unwrap ( ) ;
403397
404- let swapped_join = optimized_join
405- . as_ref ( )
406- . downcast_ref :: < HashJoinExec > ( )
407- . expect (
408- "A proj is not required to swap columns back to their original order" ,
409- ) ;
398+ let swapped_join = optimized_join. downcast_ref :: < HashJoinExec > ( ) . expect (
399+ "A proj is not required to swap columns back to their original order" ,
400+ ) ;
410401
411402 assert_eq ! ( swapped_join. schema( ) . fields( ) . len( ) , 2 ) ;
412403 assert_eq ! (
@@ -534,7 +525,6 @@ async fn test_join_no_swap() {
534525 . unwrap ( ) ;
535526
536527 let swapped_join = optimized_join
537- . as_ref ( )
538528 . downcast_ref :: < HashJoinExec > ( )
539529 . expect ( "The type of the plan should not be changed" ) ;
540530
@@ -583,7 +573,6 @@ async fn test_nl_join_with_swap(join_type: JoinType) {
583573 . unwrap ( ) ;
584574
585575 let swapping_projection = optimized_join
586- . as_ref ( )
587576 . downcast_ref :: < ProjectionExec > ( )
588577 . expect ( "A proj is required to swap columns back to their original order" ) ;
589578
@@ -597,7 +586,6 @@ async fn test_nl_join_with_swap(join_type: JoinType) {
597586
598587 let swapped_join = swapping_projection
599588 . input ( )
600- . as_ref ( )
601589 . downcast_ref :: < NestedLoopJoinExec > ( )
602590 . expect ( "The type of the plan should not be changed" ) ;
603591
@@ -664,7 +652,6 @@ async fn test_nl_join_with_swap_no_proj(join_type: JoinType) {
664652 . unwrap ( ) ;
665653
666654 let swapped_join = optimized_join
667- . as_ref ( )
668655 . downcast_ref :: < NestedLoopJoinExec > ( )
669656 . expect ( "The type of the plan should not be changed" ) ;
670657
@@ -759,7 +746,6 @@ async fn test_hash_join_swap_on_joins_with_projections(
759746 . swap_inputs ( PartitionMode :: Partitioned )
760747 . expect ( "swap_hash_join must support joins with projections" ) ;
761748 let swapped_join = swapped
762- . as_ref ( )
763749 . downcast_ref :: < HashJoinExec > ( )
764750 . expect (
765751 "ProjectionExec won't be added above if HashJoinExec contains embedded projection" ,
@@ -928,18 +914,15 @@ fn check_join_partition_mode(
928914
929915 if !is_swapped {
930916 let swapped_join = optimized_join
931- . as_ref ( )
932917 . downcast_ref :: < HashJoinExec > ( )
933918 . expect ( "The type of the plan should not be changed" ) ;
934919 assert_eq ! ( * swapped_join. partition_mode( ) , expected_mode) ;
935920 } else {
936921 let swapping_projection = optimized_join
937- . as_ref ( )
938922 . downcast_ref :: < ProjectionExec > ( )
939923 . expect ( "A proj is required to swap columns back to their original order" ) ;
940924 let swapped_join = swapping_projection
941925 . input ( )
942- . as_ref ( )
943926 . downcast_ref :: < HashJoinExec > ( )
944927 . expect ( "The type of the plan should not be changed" ) ;
945928
@@ -1589,10 +1572,9 @@ async fn test_join_with_maybe_swap_unbounded_case(t: TestCase) -> Result<()> {
15891572 JoinSelection :: new ( ) . optimize ( Arc :: clone ( & join) , & ConfigOptions :: new ( ) ) ?;
15901573
15911574 // If swap did happen
1592- let projection_added = optimized_join_plan. as_ref ( ) . is :: < ProjectionExec > ( ) ;
1575+ let projection_added = optimized_join_plan. is :: < ProjectionExec > ( ) ;
15931576 let plan = if projection_added {
15941577 let proj = optimized_join_plan
1595- . as_ref ( )
15961578 . downcast_ref :: < ProjectionExec > ( )
15971579 . expect ( "A proj is required to swap columns back to their original order" ) ;
15981580 Arc :: < dyn ExecutionPlan > :: clone ( proj. input ( ) )
@@ -1606,7 +1588,7 @@ async fn test_join_with_maybe_swap_unbounded_case(t: TestCase) -> Result<()> {
16061588 join_type,
16071589 mode,
16081590 ..
1609- } ) = plan. as_ref ( ) . downcast_ref :: < HashJoinExec > ( )
1591+ } ) = plan. downcast_ref :: < HashJoinExec > ( )
16101592 {
16111593 let left_changed = Arc :: ptr_eq ( left, & right_exec) ;
16121594 let right_changed = Arc :: ptr_eq ( right, & left_exec) ;
0 commit comments