Github user kanzhang commented on a diff in the pull request:
https://github.com/apache/spark/pull/1338#discussion_r15431198
--- Diff: python/pyspark/rdd.py ---
@@ -964,6 +964,106 @@ def first(self):
"""
return self.take(1)[0]
+ def saveAsNewAPIHadoopDataset(self, conf, keyConverter=None,
valueConverter=None):
+ """
+ Output a Python RDD of key-value pairs (of form C{RDD[(K, V)]}) to
any Hadoop file
+ system, using the new Hadoop OutputFormat API (mapreduce package).
Keys/values are
+ converted for output using either user specified converters or, by
default,
+ L{org.apache.spark.api.python.JavaToWritableConverter}.
+
+ @param conf: Hadoop job configuration, passed in as a dict
+ @param keyConverter: (None by default)
+ @param valueConverter: (None by default)
+ """
+ jconf = self.ctx._dictToJavaMap(conf)
+ reserialized =
self._reserialize(BatchedSerializer(PickleSerializer(), 10))
--- End diff --
@JoshRosen @MLnick the batch size here only affects transient data when
writing and the re-serialization shouldn't be done if the data is already in
pickle format (batch serialized or not). I'm uploading a patch to that effect.
Since the batch size has no effect on the data persisted in files, I'm not
exposing it to users. See you have any further comments and if you have a
better suggestion for the default size 10, let me know.
@mateiz what you suggested is exposing the batch size for reading. I'll
work on that next.
---
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.
---