Re: saveAsTextFile error

2014-11-15 Thread Prannoy
Hi Niko, 

Have you tried it running keeping the wordCounts.print() ?? Possibly the
import to the package *org.apache.spark.streaming._* is not there so during
sbt package it is unable to locate the saveAsTextFile API. 

Go to
https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/streaming/NetworkWordCount.scala
to check if all the needed packages are there. 

Thanks.



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/saveAsTextFile-error-tp18960p19006.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org



Re: saveAsTextFile error

2014-11-14 Thread Harold Nguyen
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