Skip to content

Commit 51f7fb9

Browse files
committed
port from SPARK-19017
1 parent bcae336 commit 51f7fb9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ class SQLQueryTestSuite extends QueryTest with SharedSQLContext {
163163
s"-- Number of queries: ${outputs.size}\n\n\n" +
164164
outputs.zipWithIndex.map{case (qr, i) => qr.toString(i)}.mkString("\n\n\n") + "\n"
165165
}
166-
stringToFile(new File(testCase.resultFile), goldenOutput)
166+
val resultFile = new File(testCase.resultFile);
167+
val parent = resultFile.getParentFile();
168+
if (!parent.exists()) {
169+
assert(parent.mkdirs(), "Could not create directory: " + parent)
170+
}
171+
stringToFile(resultFile, goldenOutput)
167172
}
168173

169174
// Read back the golden file.

0 commit comments

Comments
 (0)