File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
streaming/src/main/scala/org/apache/spark/streaming/dstream Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ def _sum(self):
5656 """
5757 Add up the elements in this DStream.
5858 """
59- return self ._mapPartitions (lambda x : [sum (x )]).reduce (operator .add )
59+ pass
60+ #return self._mapPartitions(lambda x: [sum(x)]).reduce(operator.add)
6061
6162 def print_ (self , label = None ):
6263 """
@@ -152,7 +153,7 @@ def combineLocally(iterator):
152153 else :
153154 combiners [k ] = mergeValue (combiners [k ], v )
154155 return combiners .iteritems ()
155- locally_combined = self .mapPartitions (combineLocally )
156+ locally_combined = self ._mapPartitions (combineLocally )
156157 shuffled = locally_combined .partitionBy (numPartitions )
157158
158159 def _mergeCombiners (iterator ):
Original file line number Diff line number Diff line change @@ -620,7 +620,7 @@ abstract class DStream[T: ClassTag] (
620620 new ForEachDStream (this , context.sparkContext.clean(foreachFunc)).register()
621621 }
622622
623- // TODO move pyprint to PythonDStream and executed by py4j call back function
623+ // TODO: move pyprint to PythonDStream and executed by py4j call back function
624624 /**
625625 * Print the first ten elements of each PythonRDD generated in this PythonDStream. This is an output
626626 * operator, so this PythonDStream will be registered as an output stream and there materialized.
@@ -644,6 +644,7 @@ abstract class DStream[T: ClassTag] (
644644
645645 // pythonExec should be passed from python. Move pyprint to PythonDStream
646646 val pythonExec = new ProcessBuilder ().environment().get(" PYSPARK_PYTHON" )
647+
647648 val sparkHome = new ProcessBuilder ().environment().get(" SPARK_HOME" )
648649 // Call python script to deserialize and print result in stdout
649650 val pb = new ProcessBuilder (pythonExec, sparkHome + " /python/pyspark/streaming/pyprint.py" , tempFile.getAbsolutePath)
You can’t perform that action at this time.
0 commit comments