Skip to content

Commit ebf49b4

Browse files
fix: format within_group error message (#16613)
1 parent 1c0dcad commit ebf49b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

datafusion/sql/src/expr/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
228228
}
229229

230230
if !order_by.is_empty() && !within_group.is_empty() {
231-
return plan_err!("ORDER BY and WITHIN GROUP clauses cannot be used together in the same aggregate function. ");
231+
return plan_err!("ORDER BY and WITHIN GROUP clauses cannot be used together in the same aggregate function");
232232
}
233233

234234
// If function is a window function (it has an OVER clause),

datafusion/sqllogictest/test_files/aggregate.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7053,6 +7053,6 @@ FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);
70537053
----
70547054
[a, c, d]
70557055

7056-
query error Error during planning: ORDER BY and WITHIN GROUP clauses cannot be used together in the same aggregate function.
7056+
query error Error during planning: ORDER BY and WITHIN GROUP clauses cannot be used together in the same aggregate function
70577057
SELECT array_agg(a_varchar order by a_varchar) WITHIN GROUP (ORDER BY a_varchar)
70587058
FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);

0 commit comments

Comments
 (0)