diff options
author | Udo Klein <git@blinkenlight.net> | 2016-01-11 09:30:08 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-01-11 09:30:08 +0000 |
commit | bd723bd53d9a28239b60939a248a4ea13340aad8 (patch) | |
tree | b9909507d7d3177cdc81b8483c2db4ab5a5a84c4 /examples/src/main | |
parent | f253feff62f3eb3cce22bbec0874f317a61b0092 (diff) | |
download | spark-bd723bd53d9a28239b60939a248a4ea13340aad8.tar.gz spark-bd723bd53d9a28239b60939a248a4ea13340aad8.tar.bz2 spark-bd723bd53d9a28239b60939a248a4ea13340aad8.zip |
removed lambda from sortByKey()
According to the documentation the sortByKey method does not take a lambda as an argument, thus the example is flawed. Removed the argument completely as this will default to ascending sort.
Author: Udo Klein <git@blinkenlight.net>
Closes #10640 from udoklein/patch-1.
Diffstat (limited to 'examples/src/main')
-rwxr-xr-x | examples/src/main/python/sort.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/python/sort.py b/examples/src/main/python/sort.py index f6b0ecb02c..b6c2916254 100755 --- a/examples/src/main/python/sort.py +++ b/examples/src/main/python/sort.py @@ -30,7 +30,7 @@ if __name__ == "__main__": lines = sc.textFile(sys.argv[1], 1) sortedCount = lines.flatMap(lambda x: x.split(' ')) \ .map(lambda x: (int(x), 1)) \ - .sortByKey(lambda x: x) + .sortByKey() # This is just a demo on how to bring all the sorted data back to a single node. # In reality, we wouldn't want to collect all the data to the driver node. output = sortedCount.collect() |