You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2017/10/11 11:41:17 UTC
[GitHub] spark pull request #19464: [SPARK-22233] [core] Allow user to filter out emp...
Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/19464#discussion_r143984294
--- Diff: core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala ---
@@ -122,7 +122,10 @@ class NewHadoopRDD[K, V](
case _ =>
}
val jobContext = new JobContextImpl(_conf, jobId)
- val rawSplits = inputFormat.getSplits(jobContext).toArray
+ var rawSplits = inputFormat.getSplits(jobContext).toArray(Array.empty[InputSplit])
+ if (sparkContext.getConf.getBoolean("spark.hadoop.filterOutEmptySplit", false)) {
+ rawSplits = rawSplits.filter(_.getLength>0)
--- End diff --
Space around operator.
You should filter before making an array.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org