diff --git a/native/core/src/execution/datafusion/planner.rs b/native/core/src/execution/datafusion/planner.rs index a9c900b4f..9cc058c56 100644 --- a/native/core/src/execution/datafusion/planner.rs +++ b/native/core/src/execution/datafusion/planner.rs @@ -1567,14 +1567,17 @@ impl PhysicalPlanner { } // Cast sort expressions to Int64 to match DataFusion's window frame (offsets are Int64) - let cast_sort_exprs: Vec = sort_exprs.iter().map(|sort_expr| { - let expr = sort_expr.expr.clone(); - let cast_expr = Arc::new(CastExpr::new(expr, DataType::Int64, None)); - PhysicalSortExpr { - expr: cast_expr, - options: sort_expr.options.clone(), - } - }).collect(); + let cast_sort_exprs: Vec = sort_exprs + .iter() + .map(|sort_expr| { + let expr = sort_expr.expr.clone(); + let cast_expr = Arc::new(CastExpr::new(expr, DataType::Int64, None)); + PhysicalSortExpr { + expr: cast_expr, + options: sort_expr.options.clone(), + } + }) + .collect(); let window_func = match self.find_df_window_function(&window_func_name) { Some(f) => f,