cloud-fan commented on a change in pull request #31973:
URL: https://github.com/apache/spark/pull/31973#discussion_r603032615
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/interfaces.scala
##########
@@ -203,8 +203,7 @@ abstract class AggregateFunction extends Expression {
def inputAggBufferAttributes: Seq[AttributeReference]
/**
- * Result of the aggregate function when the input is empty. This is
currently only used for the
- * proper rewriting of distinct aggregate functions.
+ * Result of the aggregate function when the input is empty.
*/
def defaultResult: Option[Literal] = None
Review comment:
This is a good catch!
One more idea is to create an automatic test to check all the aggregate
functions and make sure `defaultResult` matches the actual behavior: initialize
the aggregate buffer and get the result directly.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]