huaxingao commented on code in PR #15014: URL: https://github.com/apache/datafusion/pull/15014#discussion_r1986441543
########## 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: Sorry I missed the previous message. Spark has this: https://spark.apache.org/docs/latest/api/sql/index.html#first ``` > SELECT first(col) FROM VALUES (10), (5), (20) AS tab(col); 10 > SELECT first(col) FROM VALUES (NULL), (5), (20) AS tab(col); NULL > SELECT first(col, true) FROM VALUES (NULL), (5), (20) AS tab(col); 5 ``` -- 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