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

    https://github.com/apache/spark/pull/5134#discussion_r29218048
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -115,6 +115,25 @@ object UnionPushdown extends Rule[LogicalPlan] {
      */
     object ColumnPruning extends Rule[LogicalPlan] {
       def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    +    // Eliminate unneeded attributes from Expand that is used in 
GroupingSets
    +    case a @ Aggregate(groupByExprs, aggregations, e @ Expand(projections, 
output, child))
    +        if (e.outputSet -- a.references).nonEmpty =>
    +
    +      val substitution = projections.map { groupExpr =>
    +        val newExprs = groupExpr.collect {
    +          case x: NamedExpression if a.references.contains(x) => x
    +          case l: Literal => l
    --- End diff --
    
    Because there are some constant null values and bitmasks we need to keep 
them.


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