Hi Niko,
It looks like you are calling a method on DStream, which does not exist.
Check out:
https://spark.apache.org/docs/1.1.0/streaming-programming-guide.html#output-operations-on-dstreams
for the method saveAsTextFiles
Harold
On Fri, Nov 14, 2014 at 10:39 AM, Niko Gamulin niko.gamu...@gmail.com
wrote:
Hi,
I tried to modify NetworkWordCount example in order to save the output to
a file.
In NetworkWordCount.scala I replaced the line
wordCounts.print()
with
wordCounts.saveAsTextFile(/home/bart/rest_services/output.txt)
When I ran sbt/sbt package it returned the following error:
[error]
/home/bart/spark-1.1.0/examples/src/main/scala/org/apache/spark/examples/streaming/NetworkWordCountModified.scala:57:
value saveAsTextFile is not a member of
org.apache.spark.streaming.dstream.DStream[(String, Int)]
[error]
wordCounts.saveAsTextFile(/home/bart/rest_services/output.txt)
[error]^
[error] one error found
[error] (examples/compile:compile) Compilation failed
[error] Total time: 5 s, completed Nov 14, 2014 9:38:53 PM
Does anyone know why this error occurs?
Is there any other way to save the results to a text file?
Regards,
Niko