Skip to content

Commit f485b1d

Browse files
Ken Takagiwagiwa
Ken Takagiwa
authored andcommitted
fied input of socketTextDStream
1 parent dd6de81 commit f485b1d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/src/main/python/streaming/nerwork_wordcount.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
exit(-1)
1111
ssc = StreamingContext(appName="PythonStreamingNetworkWordCount", duration=Seconds(1))
1212

13-
lines = ssc.socketTextStream(sys.argv[1], sys.argv[2])
13+
lines = ssc.socketTextStream(sys.argv[1], int(sys.argv[2]))
1414
fm_lines = lines.flatMap(lambda x: x.split(" "))
1515
filtered_lines = fm_lines.filter(lambda line: "Spark" in line)
1616
mapped_lines = fm_lines.map(lambda x: (x, 1))

python/pyspark/java_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def run(self):
111111
java_import(gateway.jvm, "org.apache.spark.streaming.*") # do we need this?
112112
java_import(gateway.jvm, "org.apache.spark.streaming.api.java.*")
113113
java_import(gateway.jvm, "org.apache.spark.streaming.api.python.*")
114-
java_import(gateway.jvm, "org.apache.spark.streaming.dstream.*") # do we need this?
114+
java_import(gateway.jvm, "org.apache.spark.streaming.dstream.*")
115115
java_import(gateway.jvm, "org.apache.spark.mllib.api.python.*")
116116
java_import(gateway.jvm, "org.apache.spark.sql.SQLContext")
117117
java_import(gateway.jvm, "org.apache.spark.sql.hive.HiveContext")

0 commit comments

Comments
 (0)