From 288b699cd1f814c0e20b9b8838f57ec768987e18 Mon Sep 17 00:00:00 2001 From: petermaxlee Date: Wed, 10 Aug 2016 00:33:47 -0700 Subject: [PATCH] better message for assert. --- .../test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala index 81af67e8486c1..08b8432d68eb3 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala @@ -150,7 +150,11 @@ class SQLQueryTestSuite extends QueryTest with SharedSQLContext { val expectedOutputs: Seq[QueryOutput] = { val goldenOutput = fileToString(new File(testCase.resultFile)) val segments = goldenOutput.split("-- !query.+\n") - assert(segments.size == outputs.size * 3 + 1) // each query has 3 segments, plus the header + + // each query has 3 segments, plus the header + assert(segments.size == outputs.size * 3 + 1, + s"Expected ${outputs.size * 3 + 1} blocks in result file but got ${segments.size}. " + + s"Try regenerate the result files.") Seq.tabulate(outputs.size) { i => QueryOutput( sql = segments(i * 3 + 1).trim,