From 61569906ccafe4f1d10a61882d564e4bb16665ef Mon Sep 17 00:00:00 2001 From: Josh Rosen Date: Thu, 23 Jan 2014 15:09:19 -0800 Subject: Fix SPARK-978: ClassCastException in PySpark cartesian. --- python/pyspark/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'python/pyspark/tests.py') 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): -- cgit v1.2.3