aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/tests.py
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@apache.org>2014-01-23 15:09:19 -0800
committerJosh Rosen <joshrosen@apache.org>2014-01-23 15:09:19 -0800
commit61569906ccafe4f1d10a61882d564e4bb16665ef (patch)
tree93e62caa03e68cd5834112676df0e80369cd3cf2 /python/pyspark/tests.py
parent0035dbbc8125af94ae27cb6f10e87aa6f5a078b1 (diff)
downloadspark-61569906ccafe4f1d10a61882d564e4bb16665ef.tar.gz
spark-61569906ccafe4f1d10a61882d564e4bb16665ef.tar.bz2
spark-61569906ccafe4f1d10a61882d564e4bb16665ef.zip
Fix SPARK-978: ClassCastException in PySpark cartesian.
Diffstat (limited to 'python/pyspark/tests.py')
-rw-r--r--python/pyspark/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py
index 05a9f7f0d1..acd1ca5676 100644
--- a/python/pyspark/tests.py
+++ b/python/pyspark/tests.py
@@ -159,6 +159,15 @@ class TestRDDFunctions(PySparkTestCase):
cart = rdd1.cartesian(rdd2)
result = cart.map(lambda (x, y): x + y).collect()
+ def test_cartesian_on_textfile(self):
+ # Regression test for
+ path = os.path.join(SPARK_HOME, "python/test_support/hello.txt")
+ a = self.sc.textFile(path)
+ result = a.cartesian(a).collect()
+ (x, y) = result[0]
+ self.assertEqual("Hello World!", x.strip())
+ self.assertEqual("Hello World!", y.strip())
+
class TestIO(PySparkTestCase):