diff options
Diffstat (limited to 'examples/src/main/python/sort.py')
-rwxr-xr-x | examples/src/main/python/sort.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/src/main/python/sort.py b/examples/src/main/python/sort.py index 5de20a6d98..4913ee926a 100755 --- a/examples/src/main/python/sort.py +++ b/examples/src/main/python/sort.py @@ -21,11 +21,11 @@ from pyspark import SparkContext if __name__ == "__main__": - if len(sys.argv) < 3: - print >> sys.stderr, "Usage: sort <master> <file>" + if len(sys.argv) != 2: + print >> sys.stderr, "Usage: sort <file>" exit(-1) - sc = SparkContext(sys.argv[1], "PythonSort") - lines = sc.textFile(sys.argv[2], 1) + sc = SparkContext(appName="PythonSort") + lines = sc.textFile(sys.argv[1], 1) sortedCount = lines.flatMap(lambda x: x.split(' ')) \ .map(lambda x: (int(x), 1)) \ .sortByKey(lambda x: x) |