Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16461#discussion_r94421552
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
 ---
    @@ -436,7 +436,6 @@ abstract class AggregateWindowFunction extends 
DeclarativeAggregate with WindowF
       override val frame = SpecifiedWindowFrame(RowFrame, UnboundedPreceding, 
CurrentRow)
       override def dataType: DataType = IntegerType
       override def nullable: Boolean = true
    -  override def supportsPartial: Boolean = false
    --- End diff --
    
    No, it is not. These function should calculate a result for each value in a 
group for a single key. They also require that the group is ordered. Using 
these in a regular aggregate does not make much sense since they would degrade 
into a count, a distinct count (if the groups are ordered, random otherwise), 
or some constant (1 probably).
    
    I think throwing an NotImplementedError is fine in this case, there is 
logic in Catalyst to prevent a user from using these function is a regular 
aggregate.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to