cloud-fan commented on code in PR #42971:
URL: https://github.com/apache/spark/pull/42971#discussion_r1329419904


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala:
##########
@@ -1410,6 +1410,21 @@ class AnalysisSuite extends AnalysisTest with Matchers {
     assertAnalysisSuccess(finalPlan)
   }
 
+  test("Remove extra project as long as all attributes are semantically the 
same") {
+    val analyzer = getAnalyzer
+    val inner = Project(
+      Seq(
+        Alias(testRelation2.output(0), "a")(),
+        testRelation2.output(1),
+        Alias(testRelation2.output(2), "c")(),
+        testRelation2.output(3),
+        testRelation2.output(4),
+      ),
+      testRelation2)
+    val actual_plan = analyzer.simplifyPlanForCollectedMetrics(inner)

Review Comment:
   note: now we only call `simplifyPlanForCollectedMetrics` with canonicalized 
plan. We should match it in the tests.



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