Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions datafusion/sql/src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
let plan = if let Some(qualify_expr) = qualify_expr_post_aggr {
if plan_nested_windows {
if !qualify_had_window_functions {
return plan_err!(
"QUALIFY clause requires window functions in the SELECT list or QUALIFY clause"
);
return plan_err!("found QUALIFY clause but no window function.");
}
self.validate_schema_satisfies_exprs(
plan.schema(),
Expand All @@ -594,9 +592,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
.chain(std::iter::once(&qualify_expr)),
);
if qualify_window_func_exprs.is_empty() {
return plan_err!(
"QUALIFY clause requires window functions in the SELECT list or QUALIFY clause"
);
return plan_err!("found QUALIFY clause but no window function.");
}

// now attempt to resolve columns and replace with fully-qualified columns
Expand Down
4 changes: 2 additions & 2 deletions datafusion/sql/tests/sql_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5218,7 +5218,7 @@ fn test_select_qualify_without_window_function() {
let err = logical_plan(sql).unwrap_err();
assert_eq!(
err.strip_backtrace(),
"Error during planning: QUALIFY clause requires window functions in the SELECT list or QUALIFY clause"
"Error during planning: found QUALIFY clause but no window function."
);
}

Expand All @@ -5228,7 +5228,7 @@ fn test_select_qualify_without_window_function_but_window_in_order_by() {
let err = logical_plan(sql).unwrap_err();
assert_eq!(
err.strip_backtrace(),
"Error during planning: QUALIFY clause requires window functions in the SELECT list or QUALIFY clause"
"Error during planning: found QUALIFY clause but no window function."
);
}

Expand Down
Loading