You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2023/09/27 18:10:32 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #43155: [SPARK-45357][CONNECT][TESTS] Normalize `dataframeId` when comparing `CollectMetrics` in `SparkConnectProtoSuite`

LuciferYang commented on code in PR #43155:
URL: https://github.com/apache/spark/pull/43155#discussion_r1339014960


##########
connector/connect/server/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -1068,6 +1068,10 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
   // Compares proto plan with LogicalPlan.
   private def comparePlans(connectPlan: proto.Relation, sparkPlan: LogicalPlan): Unit = {
     val connectAnalyzed = analyzePlan(transform(connectPlan))
-    comparePlans(connectAnalyzed, sparkPlan, false)
+    (connectAnalyzed, sparkPlan) match {

Review Comment:
   In the current scenario, `connectAnalyzed` is transformed from `proto.Relation`. When it is `CollectMetrics`, the `dataframeId` is always 0.
   
   But if the `sparkPlan` is `CollectMetrics`, its `dataframeId` value is determined by its corresponding DataFrame.
   
   In the sbt test, `SparkConnectProtoSuite` is tested earlier, `sparkTestRelation` is the first created `DataFrame` with `id` as 0, thus the GA test didn't trigger the failure described in the pr.
   
   When using Maven for testing, `SparkConnectProtoSuite` is tested later, `sparkTestRelation` is not the first created `DataFrame` with `id` not being 0, thus causing the test to fail.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org