diff options
author | Josh Rosen <joshrosen@apache.org> | 2014-01-23 15:09:19 -0800 |
---|---|---|
committer | Josh Rosen <joshrosen@apache.org> | 2014-01-23 15:09:19 -0800 |
commit | 61569906ccafe4f1d10a61882d564e4bb16665ef (patch) | |
tree | 93e62caa03e68cd5834112676df0e80369cd3cf2 /python | |
parent | 0035dbbc8125af94ae27cb6f10e87aa6f5a078b1 (diff) | |
download | spark-61569906ccafe4f1d10a61882d564e4bb16665ef.tar.gz spark-61569906ccafe4f1d10a61882d564e4bb16665ef.tar.bz2 spark-61569906ccafe4f1d10a61882d564e4bb16665ef.zip |
Fix SPARK-978: ClassCastException in PySpark cartesian.
Diffstat (limited to 'python')
-rw-r--r-- | python/pyspark/tests.py | 9 |
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): |