spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niko Gamulin <niko.gamu...@gmail.com>
Subject saveAsTextFile error
Date Fri, 14 Nov 2014 18:39:27 GMT
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

Mime
View raw message