File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
examples/src/main/python/streaming Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change 10
10
exit (- 1 )
11
11
ssc = StreamingContext (appName = "PythonStreamingNetworkWordCount" , duration = Seconds (1 ))
12
12
13
- lines = ssc .socketTextStream (sys .argv [1 ], sys .argv [2 ])
13
+ lines = ssc .socketTextStream (sys .argv [1 ], int ( sys .argv [2 ]) )
14
14
fm_lines = lines .flatMap (lambda x : x .split (" " ))
15
15
filtered_lines = fm_lines .filter (lambda line : "Spark" in line )
16
16
mapped_lines = fm_lines .map (lambda x : (x , 1 ))
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def run(self):
111
111
java_import (gateway .jvm , "org.apache.spark.streaming.*" ) # do we need this?
112
112
java_import (gateway .jvm , "org.apache.spark.streaming.api.java.*" )
113
113
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.*" )
115
115
java_import (gateway .jvm , "org.apache.spark.mllib.api.python.*" )
116
116
java_import (gateway .jvm , "org.apache.spark.sql.SQLContext" )
117
117
java_import (gateway .jvm , "org.apache.spark.sql.hive.HiveContext" )
You can’t perform that action at this time.
0 commit comments