Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/11828#discussion_r56743668
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -305,21 +306,14 @@ object SetOperationPushDown extends Rule[LogicalPlan]
with PredicateHelper {
}
/**
- * Attempts to eliminate the reading of unneeded columns from the query
plan using the following
- * transformations:
- *
- * - Inserting Projections beneath the following operators:
- * - Aggregate
- * - Generate
- * - Project <- Join
- * - LeftSemiJoin
+ * Attempts to eliminate the reading of unneeded columns from the query
plan.
*/
object ColumnPruning extends Rule[LogicalPlan] {
private def sameOutput(output1: Seq[Attribute], output2:
Seq[Attribute]): Boolean =
output1.size == output2.size &&
output1.zip(output2).forall(pair => pair._1.semanticEquals(pair._2))
- def apply(plan: LogicalPlan): LogicalPlan = plan transform {
+ def apply(plan: LogicalPlan): LogicalPlan =
removeProjectBeforeFilter(plan transform {
--- End diff --
Unable to reproduce the stack overflow now, if we keep the following lines
in `ColumnPruning`:
```scala
// Eliminate no-op Projects
case p @ Project(projectList, child) if sameOutput(child.output,
p.output) => child
```
If we remove the above line, we will get the stack overflow easily because
we can generate duplicate `Project`. Anyway, I am fine if you want to use
`transformDown`.
---
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]