Github user yinxusen commented on a diff in the pull request:
https://github.com/apache/spark/pull/376#discussion_r11469988
--- Diff:
core/src/main/scala/org/apache/spark/input/WholeTextFileInputFormat.scala ---
@@ -44,4 +47,15 @@ private[spark] class WholeTextFileInputFormat extends
CombineFileInputFormat[Str
context,
classOf[WholeTextFileRecordReader])
}
+
+ /**
+ * Allow minSplits set by end-user in order to keep compatibility with
old Hadoop API.
+ */
+ def setMaxSplitSize(context: JobContext, minSplits: Int) {
+ val files = listStatus(context)
+ val totalLen = files.map { file =>
+ if (file.isDir) 0L else file.getLen
+ }.sum
+ super.setMaxSplitSize(totalLen / (if (minSplits == 0) 1 else
minSplits))
--- End diff --
Then I'll use round up other than round down for the division.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---