@@ -69,6 +69,7 @@ use arrow::{compute::can_cast_types, datatypes::DataType};
6969use async_trait:: async_trait;
7070use datafusion_common:: OuterQueryCursor ;
7171use datafusion_expr:: expr_fn:: binary_expr;
72+ use datafusion_expr:: WindowFrameBound ;
7273use datafusion_physical_expr:: expressions:: { any, OuterColumn } ;
7374use futures:: future:: BoxFuture ;
7475use futures:: { FutureExt , StreamExt , TryStreamExt } ;
@@ -1433,12 +1434,18 @@ pub fn create_window_expr_with_name(
14331434 ) ) ,
14341435 } )
14351436 . collect :: < Result < Vec < _ > > > ( ) ?;
1436- if window_frame. is_some ( ) {
1437- return Err ( DataFusionError :: NotImplemented (
1438- "window expression with window frame definition is not yet supported"
1439- . to_owned ( ) ,
1440- ) ) ;
1441- }
1437+ let window_frame = match window_frame {
1438+ Some ( window_frame) => match ( & window_frame. start_bound , & window_frame. end_bound ) {
1439+ ( WindowFrameBound :: Preceding ( None ) , WindowFrameBound :: CurrentRow )
1440+ | ( WindowFrameBound :: Preceding ( None ) , WindowFrameBound :: Following ( None ) )
1441+ | ( WindowFrameBound :: CurrentRow , WindowFrameBound :: Following ( None ) ) => & None ,
1442+ ( _, _) => return Err ( DataFusionError :: NotImplemented (
1443+ "window expression with window frame definition is not yet supported"
1444+ . to_owned ( ) ,
1445+ ) ) ,
1446+ } ,
1447+ None => & None ,
1448+ } ;
14421449 windows:: create_window_expr (
14431450 fun,
14441451 name,
0 commit comments