Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
giwa committed Sep 20, 2014
1 parent 5c04a5f commit bd3ba53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ private[spark] object PythonRDD extends Logging {
} catch {
case eof: EOFException => {}
}
println("RDDDD ==================")
println(objs)
JavaRDD.fromRDD(sc.sc.parallelize(objs, parallelism))
}

Expand Down
10 changes: 7 additions & 3 deletions examples/src/main/python/streaming/test_oprations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
conf = SparkConf()
conf.setAppName("PythonStreamingNetworkWordCount")
ssc = StreamingContext(conf=conf, duration=Seconds(1))
ssc.checkpoint("/tmp/spark_ckp")

test_input = ssc._testInputStream([1,1,1,1])
mapped = test_input.map(lambda x: (x, 1))
mapped.pyprint()
test_input = ssc._testInputStream([[1],[1],[1]])
# ssc.checkpoint("/tmp/spark_ckp")
fm_test = test_input.flatMap(lambda x: x.split(" "))
mapped_test = fm_test.map(lambda x: (x, 1))


mapped_test.print_()
ssc.start()
# ssc.awaitTermination()
# ssc.stop()

0 comments on commit bd3ba53

Please sign in to comment.