From 8db4073df2fc1f9d98771d273f5e38542aa8f31a Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 15 Jun 2015 16:47:19 +0100 Subject: [PATCH] Add a test for rdd pipe functions --- python/pyspark/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py index d8e319994cc96..e38872a9f9b4e 100644 --- a/python/pyspark/tests.py +++ b/python/pyspark/tests.py @@ -873,6 +873,13 @@ def test_sortByKey_uses_all_partitions_not_only_first_and_last(self): sizes = sort.glom().map(len).collect() for size in sizes: self.assertGreater(size, 0) + + def test_pipe_functions(self): + data = ['1','2','3'] + rdd = self.sc.parallelize(data) + self.assertRaises(Exception, rdd.pipe('cc').collect()) + result = rdd.pipe('cat').collect().sort() + [self.assertEqual(x, y) for x, y in zip(data, result)] class ProfilerTests(PySparkTestCase):