aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/context.py
diff options
context:
space:
mode:
authoriAmGhost <kdh7807@gmail.com>2014-08-16 16:48:38 -0700
committerJosh Rosen <joshrosen@apache.org>2014-08-16 16:48:38 -0700
commit379e7585c356f20bf8b4878ecba9401e2195da12 (patch)
tree4e52dc8ede559172224a6a85ade203f087606f8e /python/pyspark/context.py
parentac6411c6e75906997c78de23dfdbc8d225b87cfd (diff)
downloadspark-379e7585c356f20bf8b4878ecba9401e2195da12.tar.gz
spark-379e7585c356f20bf8b4878ecba9401e2195da12.tar.bz2
spark-379e7585c356f20bf8b4878ecba9401e2195da12.zip
[SPARK-3035] Wrong example with SparkContext.addFile
https://issues.apache.org/jira/browse/SPARK-3035 fix for wrong document. Author: iAmGhost <kdh7807@gmail.com> Closes #1942 from iAmGhost/master and squashes the following commits: 487528a [iAmGhost] [SPARK-3035] Wrong example with SparkContext.addFile fix for wrong document.
Diffstat (limited to 'python/pyspark/context.py')
-rw-r--r--python/pyspark/context.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/pyspark/context.py b/python/pyspark/context.py
index 4001ecab5e..6c04923881 100644
--- a/python/pyspark/context.py
+++ b/python/pyspark/context.py
@@ -613,7 +613,7 @@ class SparkContext(object):
>>> def func(iterator):
... with open(SparkFiles.get("test.txt")) as testFile:
... fileVal = int(testFile.readline())
- ... return [x * 100 for x in iterator]
+ ... return [x * fileVal for x in iterator]
>>> sc.parallelize([1, 2, 3, 4]).mapPartitions(func).collect()
[100, 200, 300, 400]
"""