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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]