You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/22 15:16:26 UTC

[GitHub] [spark] Ngone51 commented on a change in pull request #31927: [SPARK-34822][SQL] Update the plan stability golden files even if only the explain.txt changes

Ngone51 commented on a change in pull request #31927:
URL: https://github.com/apache/spark/pull/31927#discussion_r598806204



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala
##########
@@ -101,10 +101,13 @@ trait PlanStabilitySuite extends TPCDSBase with DisableAdaptiveExecutionSuite {
     new File(goldenFilePath, name)
   }
 
-  private def isApproved(dir: File, actualSimplifiedPlan: String): Boolean = {
-    val file = new File(dir, "simplified.txt")
-    val expected = FileUtils.readFileToString(file, StandardCharsets.UTF_8)
-    expected == actualSimplifiedPlan
+  private def isApproved(
+    dir: File, actualSimplifiedPlan: String, actualExplain: String): Boolean = {

Review comment:
       nit: 4 indents

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala
##########
@@ -101,10 +101,13 @@ trait PlanStabilitySuite extends TPCDSBase with DisableAdaptiveExecutionSuite {
     new File(goldenFilePath, name)
   }
 
-  private def isApproved(dir: File, actualSimplifiedPlan: String): Boolean = {
-    val file = new File(dir, "simplified.txt")
-    val expected = FileUtils.readFileToString(file, StandardCharsets.UTF_8)
-    expected == actualSimplifiedPlan
+  private def isApproved(
+    dir: File, actualSimplifiedPlan: String, actualExplain: String): Boolean = {
+    val simplifiedFile = new File(dir, "simplified.txt")
+    val expectedSimplified = FileUtils.readFileToString(simplifiedFile, StandardCharsets.UTF_8)
+    val explainFile = new File(dir, "explain.txt")
+    val expectedExplain = FileUtils.readFileToString(explainFile, StandardCharsets.UTF_8)
+    expectedSimplified == actualSimplifiedPlan && expectedExplain == actualExplain

Review comment:
       Can we avoid the comparison between explains when `expectedSimplified != actualSimplifiedPlan`?




-- 
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:
users@infra.apache.org



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