comphead commented on code in PR #15014:
URL: https://github.com/apache/datafusion/pull/15014#discussion_r1982303977


##########
datafusion/sql/src/expr/function.rs:
##########
@@ -349,6 +349,12 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
         } else {
             // User defined aggregate functions (UDAF) have precedence in case 
it has the same name as a scalar built-in function
             if let Some(fm) = self.context_provider.get_aggregate_meta(&name) {
+                // Reject RESPECT NULLS and IGNORE NULLS for aggregate 
functions
+                // See https://github.com/apache/datafusion/issues/15006
+                if null_treatment.is_some() {

Review Comment:
   I would consider it to be a parser responsibility, for example duckDB
   
   ```
   D SELECT LAST_VALUE(column1) RESPECT NULLS FROM t
     ;
   Parser Error: syntax error at or near "RESPECT"
   LINE 1: SELECT LAST_VALUE(column1) RESPECT NULLS FROM t
                                      ^
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to