Skip to content

Commit

Permalink
add test case for lookup()
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Aug 23, 2014
1 parent be0e8ba commit 0f1bce8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,8 @@ def lookup(self, key):
>>> sorted = rdd.sortByKey()
>>> sorted.lookup(42) # fast
[42]
>>> sorted.lookup(1024)
[]
"""
self = self.filter(lambda (k, v): k == key).values()

Expand Down

0 comments on commit 0f1bce8

Please sign in to comment.