aboutsummaryrefslogtreecommitdiff
path: root/python
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:52 -0700
commit721f2fdc95032132af3d4a00dbc8399d356f8faf (patch)
tree8cc4c6aaa553bec80cc0e59a33b337d71243e67a /python
parenta12d3ae3223535e6e4c774e4a289b8b2f2e5228b (diff)
downloadspark-721f2fdc95032132af3d4a00dbc8399d356f8faf.tar.gz
spark-721f2fdc95032132af3d4a00dbc8399d356f8faf.tar.bz2
spark-721f2fdc95032132af3d4a00dbc8399d356f8faf.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. (cherry picked from commit 379e7585c356f20bf8b4878ecba9401e2195da12) Signed-off-by: Josh Rosen <joshrosen@apache.org>
Diffstat (limited to 'python')
-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]
"""