We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd27874 commit 9a57685Copy full SHA for 9a57685
examples/src/main/python/streaming/network_wordcount.py
@@ -7,13 +7,13 @@
7
if len(sys.argv) != 3:
8
print >> sys.stderr, "Usage: wordcount <hostname> <port>"
9
exit(-1)
10
- ssc = StreamingContext(appName="PythonStreamingNetworkWordCount",
+ ssc = StreamingContext(appName="PythonStreamingNetworkWordCount",
11
duration=Seconds(1))
12
13
lines = ssc.socketTextStream(sys.argv[1], int(sys.argv[2]))
14
counts = lines.flatMap(lambda line: line.split(" "))\
15
.map(lambda word: (word, 1))\
16
- .reduceByKey(lambda a,b: a+b)
+ .reduceByKey(lambda a, b: a+b)
17
counts.pyprint()
18
19
ssc.start()
0 commit comments