Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/19571#discussion_r146783934
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
---
@@ -2127,4 +2127,18 @@ class SQLQuerySuite extends QueryTest with
SQLTestUtils with TestHiveSingleton {
}
}
}
+
+ Seq("orc", "parquet").foreach { format =>
+ test(s"SPARK-15474 Write and read back non-emtpy schema with empty
dataframe - $format") {
+ withTempDir { dir =>
+ val path = dir.getCanonicalPath
+ val emptyDf = Seq((true, 1, "str")).toDF.limit(0)
+ emptyDf.write.format(format).mode("overwrite").save(path)
--- End diff --
Hm, why is `withTempPath { path =>` not used without `overwrite` instead?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]