Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/164#discussion_r10786181
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala ---
@@ -120,4 +122,22 @@ object MLUtils {
}
sum
}
+
+ /**
+ * Reads a bunch of small files from HDFS, or a local file system
(available on all nodes), or any
+ * Hadoop-supported file system URI, and return an RDD[(String, String)].
+ *
+ * @param path The directory you should specified, such as
+ * hdfs://[address]:[port]/[dir]
+ *
+ * @return RDD[(fileName: String, content: String)]
+ * i.e. the first is the file name of a file, the second one is
its content.
+ */
+ def smallTextFiles(sc: SparkContext, path: String): RDD[(String,
String)] = {
--- End diff --
The current API uses `textFile` to load text files. I suggest using
`wholeTextFile` to load the entire content of each file. `small` is not a good
name here because it is not defined.
---
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.
---