Skip to content
Snippets Groups Projects
Commit d75c3086 authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Use None instead of empty string as it's slightly smaller/faster

parent 96b50e82
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ class RDD(object):
>>> sorted(sc.parallelize([1, 1, 2, 3]).distinct().collect())
[1, 2, 3]
"""
return self.map(lambda x: (x, "")) \
return self.map(lambda x: (x, None)) \
.reduceByKey(lambda x, _: x) \
.map(lambda (x, _): x)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment