aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/accumulators.py
Commit message (Collapse)AuthorAgeFilesLines
* Add custom serializer support to PySpark.Josh Rosen2013-11-101-2/+4
| | | | | | | | | For now, this only adds MarshalSerializer, but it lays the groundwork for other supporting custom serializers. Many of these mechanisms can also be used to support deserialization of different data formats sent by Java, such as data encoded by MsgPack. This also fixes a bug in SparkContext.union().
* Add an add() method to pyspark accumulators.Ewen Cheslack-Postava2013-10-191-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Add a regular method for adding a term to accumulators in pyspark. Currently if you have a non-global accumulator, adding to it is awkward. The += operator can't be used for non-global accumulators captured via closure because it's involves an assignment. The only way to do it is using __iadd__ directly. Adding this method lets you write code like this: def main(): sc = SparkContext() accum = sc.accumulator(0) rdd = sc.parallelize([1,2,3]) def f(x): accum.add(x) rdd.foreach(f) print accum.value where using accum += x instead would have caused UnboundLocalError exceptions in workers. Currently it would have to be written as accum.__iadd__(x).
* Add Apache license headers and LICENSE and NOTICE filesMatei Zaharia2013-07-161-0/+17
|
* Remove unnecessary doctest __main__ methods.Josh Rosen2013-02-031-9/+0
|
* Remove use of abc.ABCMeta due to cloudpickle issue.Josh Rosen2013-01-231-7/+4
| | | | | | | | | cloudpickle runs into issues while pickling subclasses of AccumulatorParam, which may be related to this Python issue: http://bugs.python.org/issue7689 This seems hard to fix and the ABCMeta wasn't necessary, so I removed it.
* Make AccumulatorParam an abstract base class.Josh Rosen2013-01-211-3/+26
|
* Add __repr__ to Accumulator; fix bug in sc.accumulatorJosh Rosen2013-01-201-1/+10
|
* Add a class comment to AccumulatorMatei Zaharia2013-01-201-0/+12
|
* Added accumulators to PySparkMatei Zaharia2013-01-201-0/+166