Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/20525#discussion_r166843930 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala --- @@ -72,6 +73,26 @@ class FileBasedDataSourceSuite extends QueryTest with SharedSQLContext { } } + Seq("orc", "parquet").foreach { format => + test(s"SPARK-23271 empty RDD when saved should write a metadata only file - $format") { + withTempDir { inputPath => + withTempPath { outputPath => + val anySchema = StructType(StructField("anyName", StringType) :: Nil) + val df = spark.read.schema(anySchema).csv(inputPath.toString) --- End diff -- an easier to create an empty dataframe: `spark.emptyDataFrame.select(lit(1).as("i"))`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org