Repository: spark Updated Branches: refs/heads/branch-1.6 43b72d83e -> d4cfd2acd
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 <g...@blinkenlight.net> Closes #10640 from udoklein/patch-1. (cherry picked from commit bd723bd53d9a28239b60939a248a4ea13340aad8) Signed-off-by: Sean Owen <so...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d4cfd2ac Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d4cfd2ac Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d4cfd2ac Branch: refs/heads/branch-1.6 Commit: d4cfd2acd62f2b0638a12bbbb48a38263c04eaf8 Parents: 43b72d8 Author: Udo Klein <g...@blinkenlight.net> Authored: Mon Jan 11 09:30:08 2016 +0000 Committer: Sean Owen <so...@cloudera.com> Committed: Mon Jan 11 09:30:27 2016 +0000 ---------------------------------------------------------------------- examples/src/main/python/sort.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/d4cfd2ac/examples/src/main/python/sort.py ---------------------------------------------------------------------- diff --git a/examples/src/main/python/sort.py b/examples/src/main/python/sort.py index f6b0ecb..b6c2916 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() --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org