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

    https://github.com/apache/spark/pull/1034#discussion_r13582627
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -100,8 +100,8 @@ object ColumnPruning extends Rule[LogicalPlan] {
     object NullPropagation extends Rule[LogicalPlan] {
       def apply(plan: LogicalPlan): LogicalPlan = plan transform {
         case q: LogicalPlan => q transformExpressionsUp {
    -      case e @ Count(Literal(null, _)) => Literal(0, e.dataType)
    -      case e @ Sum(Literal(c, _)) if c == 0 => Literal(0, e.dataType)
    +      case e @ Count(Literal(null, _)) => Literal(0L, e.dataType)
    --- End diff --
    
    What do you think about casting here too, in case we ever change/specialize 
the return type of Count?


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

Reply via email to