Skip to content

Commit 8db4073

Browse files
Add a test for rdd pipe functions
1 parent 1b3dc4e commit 8db4073

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/pyspark/tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,13 @@ def test_sortByKey_uses_all_partitions_not_only_first_and_last(self):
873873
sizes = sort.glom().map(len).collect()
874874
for size in sizes:
875875
self.assertGreater(size, 0)
876+
877+
def test_pipe_functions(self):
878+
data = ['1','2','3']
879+
rdd = self.sc.parallelize(data)
880+
self.assertRaises(Exception, rdd.pipe('cc').collect())
881+
result = rdd.pipe('cat').collect().sort()
882+
[self.assertEqual(x, y) for x, y in zip(data, result)]
876883

877884

878885
class ProfilerTests(PySparkTestCase):

0 commit comments

Comments
 (0)