HyukjinKwon commented on a change in pull request #28430:
URL: https://github.com/apache/spark/pull/28430#discussion_r419183476



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/ExpressionsSchemaSuite.scala
##########
@@ -156,14 +156,16 @@ class ExpressionsSchemaSuite extends QueryTest with 
SharedSparkSession {
       stringToFile(resultFile, goldenOutput)
     }
 
+    val outputSize = outputs.size
     val expectedOutputs: Seq[QueryOutput] = {
-      val goldenOutput = fileToString(resultFile)
-      val lines = goldenOutput.split("\n")
+      val expectedGoldenOutput = fileToString(resultFile)
+      val lines = expectedGoldenOutput.split("\n")
+      val expectedSize = lines.size
 
       // The header of golden file has one line, plus four lines of the 
summary and three
       // lines of the header of schema table.
-      assert(lines.size == outputs.size + 8,
-        s"Expected ${outputs.size + 8} blocks in result file but got 
${lines.size}. " +
+      assert(expectedSize == outputSize + 8,

Review comment:
       @beliefer, can we have one string variable to keep the summary and 
header lines, and calculate the number of extra lines from the variable?




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

Reply via email to