Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/9167#discussion_r42467947
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -675,6 +676,20 @@ object PushPredicateThroughGenerate extends
Rule[LogicalPlan] with PredicateHelp
}
/**
+ * Push [[Filter]] operators through [[Aggregate]] operators in case
predicate's
+ * refrence attributes are subset of groupBy attribute set.
+ */
+object PushPredicateThroughAggregate extends Rule[LogicalPlan] with
PredicateHelper {
+
+ def apply(plan: LogicalPlan): LogicalPlan = plan transform {
+ case filter @ Filter(condition,
+ aggregate @ Aggregate(groupingExpressions, aggregateExpressions,
child))
+ if (filter.condition.references --
AttributeSet(groupingExpressions)).isEmpty =>
--- End diff --
rather than checking for complete overlap, can we pull out the expressions
for group by columns and push those down?
---
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]