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

    https://github.com/apache/spark/pull/2983#discussion_r19698090
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/GeneratedAggregate.scala 
---
    @@ -70,16 +70,29 @@ case class GeneratedAggregate(
     
         val computeFunctions = aggregatesToCompute.map {
           case c @ Count(expr) =>
    +        // If we're evaluating UnscaledValue(x), we can do Count on x 
directly, since its
    +        // UnscaledValue will be null if and only if x is null; helps with 
Average on decimals
    +        val toCount = expr match {
    +          case UnscaledValue(e) => e
    +          case _ => expr
    +        }
    --- End diff --
    
    If we change it to a rule though we'll get it in both places in this file 
and also in the non-generated case too.


---
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