Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow unbounded window frames #108

Open
wants to merge 1 commit into
base: cubesql-3-04-2022
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions datafusion/core/src/physical_plan/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ use arrow::{compute::can_cast_types, datatypes::DataType};
use async_trait::async_trait;
use datafusion_common::OuterQueryCursor;
use datafusion_expr::expr_fn::binary_expr;
use datafusion_expr::WindowFrameBound;
use datafusion_physical_expr::expressions::{any, OuterColumn};
use futures::future::BoxFuture;
use futures::{FutureExt, StreamExt, TryStreamExt};
Expand Down Expand Up @@ -1433,12 +1434,16 @@ pub fn create_window_expr_with_name(
)),
})
.collect::<Result<Vec<_>>>()?;
if window_frame.is_some() {
return Err(DataFusionError::NotImplemented(
"window expression with window frame definition is not yet supported"
.to_owned(),
));
}
let window_frame = match window_frame {
Some(window_frame) => match (&window_frame.start_bound, &window_frame.end_bound) {
(WindowFrameBound::Preceding(None), WindowFrameBound::CurrentRow) => &None,
(_, _) => return Err(DataFusionError::NotImplemented(
"window expression with window frame definition is not yet supported"
.to_owned(),
)),
},
None => &None,
};
windows::create_window_expr(
fun,
name,
Expand Down