@@ -69,6 +69,7 @@ use arrow::{compute::can_cast_types, datatypes::DataType};
69
69
use async_trait:: async_trait;
70
70
use datafusion_common:: OuterQueryCursor ;
71
71
use datafusion_expr:: expr_fn:: binary_expr;
72
+ use datafusion_expr:: WindowFrameBound ;
72
73
use datafusion_physical_expr:: expressions:: { any, OuterColumn } ;
73
74
use futures:: future:: BoxFuture ;
74
75
use futures:: { FutureExt , StreamExt , TryStreamExt } ;
@@ -1433,12 +1434,18 @@ pub fn create_window_expr_with_name(
1433
1434
) ) ,
1434
1435
} )
1435
1436
. 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
+ } ;
1442
1449
windows:: create_window_expr (
1443
1450
fun,
1444
1451
name,
0 commit comments