tanelk commented on a change in pull request #31538:
URL: https://github.com/apache/spark/pull/31538#discussion_r574761560



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -494,11 +494,14 @@ object RemoveRedundantAliases extends Rule[LogicalPlan] {
 object RemoveNoopOperators extends Rule[LogicalPlan] {
   def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
     // Eliminate no-op Projects
-    case p @ Project(_, child) if child.sameOutput(p) => child
+    case p @ Project(projectList, child)
+      if projectList.forall(isAttribute) && child.sameOutput(p) => child

Review comment:
       Would this affect other places where the `sameOutput` method is used? It 
kinda looks like fixing a symptom and the real problem is a bit deeper. The 
`sameOutput` is used only in few places, but it internally uses 
`semanticEquals` that is very common.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to