This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new ebf49b4fe5 fix: format within_group error message (#16613)
ebf49b4fe5 is described below

commit ebf49b4fe585820caaad3b8c04529633190f48be
Author: haiywu <lizero....@gmail.com>
AuthorDate: Sun Jun 29 20:25:34 2025 +0800

    fix: format within_group error message (#16613)
---
 datafusion/sql/src/expr/function.rs              | 2 +-
 datafusion/sqllogictest/test_files/aggregate.slt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/datafusion/sql/src/expr/function.rs 
b/datafusion/sql/src/expr/function.rs
index 6b23bd5c2c..d0cb4263db 100644
--- a/datafusion/sql/src/expr/function.rs
+++ b/datafusion/sql/src/expr/function.rs
@@ -228,7 +228,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
         }
 
         if !order_by.is_empty() && !within_group.is_empty() {
-            return plan_err!("ORDER BY and WITHIN GROUP clauses cannot be used 
together in the same aggregate function. ");
+            return plan_err!("ORDER BY and WITHIN GROUP clauses cannot be used 
together in the same aggregate function");
         }
 
         // If function is a window function (it has an OVER clause),
diff --git a/datafusion/sqllogictest/test_files/aggregate.slt 
b/datafusion/sqllogictest/test_files/aggregate.slt
index 5d6ef1e785..3f064485e5 100644
--- a/datafusion/sqllogictest/test_files/aggregate.slt
+++ b/datafusion/sqllogictest/test_files/aggregate.slt
@@ -7053,6 +7053,6 @@ FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);
 ----
 [a, c, d]
 
-query error Error during planning: ORDER BY and WITHIN GROUP clauses cannot be 
used together in the same aggregate function. 
+query error Error during planning: ORDER BY and WITHIN GROUP clauses cannot be 
used together in the same aggregate function
 SELECT array_agg(a_varchar order by a_varchar) WITHIN GROUP (ORDER BY 
a_varchar)
 FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@datafusion.apache.org
For additional commands, e-mail: commits-h...@datafusion.apache.org

Reply via email to