Skip to content

Commit 2781d9f

Browse files
committed
Handle empty lists for newParquet
1 parent 04dd376 commit 2781d9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/core/src/main/scala/org/apache/spark/sql/parquet/newParquet.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ case class ParquetRelation2(path: String)(@transient val sqlContext: SQLContext)
191191
val selectedPartitions = partitions.filter(p => partitionFilters.forall(_(p)))
192192
val fs = FileSystem.get(new java.net.URI(path), sparkContext.hadoopConfiguration)
193193
val selectedFiles = selectedPartitions.flatMap(_.files).map(f => fs.makeQualified(f.getPath))
194-
org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(job, selectedFiles:_*)
194+
// FileInputFormat cannot handle empty lists.
195+
if (selectedFiles.nonEmpty) {
196+
org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(job, selectedFiles: _*)
197+
}
195198

196199
// Push down filters when possible
197200
predicates

0 commit comments

Comments
 (0)