@@ -238,15 +238,15 @@ impl PhysicalOptimizerRule for WindowTopN {
238238fn extract_window_limit (
239239 predicate : & Arc < dyn datafusion_physical_expr:: PhysicalExpr > ,
240240) -> Option < ( usize , usize ) > {
241- let binary = predicate. as_any ( ) . downcast_ref :: < BinaryExpr > ( ) ?;
241+ let binary = predicate. downcast_ref :: < BinaryExpr > ( ) ?;
242242 let op = binary. op ( ) ;
243243 let left = binary. left ( ) ;
244244 let right = binary. right ( ) ;
245245
246246 // Try Column op Literal
247247 if let ( Some ( col) , Some ( lit_val) ) = (
248- left. as_any ( ) . downcast_ref :: < Column > ( ) ,
249- right. as_any ( ) . downcast_ref :: < Literal > ( ) ,
248+ left. downcast_ref :: < Column > ( ) ,
249+ right. downcast_ref :: < Literal > ( ) ,
250250 ) {
251251 let n = scalar_to_usize ( lit_val. value ( ) ) ?;
252252 return match * op {
@@ -258,8 +258,8 @@ fn extract_window_limit(
258258
259259 // Try Literal op Column (flipped)
260260 if let ( Some ( lit_val) , Some ( col) ) = (
261- left. as_any ( ) . downcast_ref :: < Literal > ( ) ,
262- right. as_any ( ) . downcast_ref :: < Column > ( ) ,
261+ left. downcast_ref :: < Literal > ( ) ,
262+ right. downcast_ref :: < Column > ( ) ,
263263 ) {
264264 let n = scalar_to_usize ( lit_val. value ( ) ) ?;
265265 return match * op {
0 commit comments