AngersZhuuuu commented on a change in pull request #33587:
URL: https://github.com/apache/spark/pull/33587#discussion_r682478603



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
##########
@@ -333,6 +333,9 @@ abstract class Star extends LeafExpression with 
NamedExpression {
   override def qualifier: Seq[String] = throw new 
UnresolvedException("qualifier")
   override def toAttribute: Attribute = throw new 
UnresolvedException("toAttribute")
   override def newInstance(): NamedExpression = throw new 
UnresolvedException("newInstance")
+
+  override def withName(newName: String): NamedExpression =

Review comment:
       Done

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -518,7 +518,22 @@ object RemoveNoopOperators extends Rule[LogicalPlan] {
   def apply(plan: LogicalPlan): LogicalPlan = plan.transformUpWithPruning(
     _.containsAnyPattern(PROJECT, WINDOW), ruleId) {
     // Eliminate no-op Projects
-    case p @ Project(_, child) if child.sameOutput(p) => child
+    case p @ Project(output, child) if child.sameOutput(p) =>
+      child match {
+        case _: Project | _: Aggregate =>

Review comment:
       Done




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

To unsubscribe, e-mail: [email protected]

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