thank you very much. just a quick question - I try to save string in this way
but the file is always empty:
val file = Path ("sample data/ZN_SPARK.OUT").createFile(true)
file.bufferedWriter().write(im.toString()) file.bufferedWriter().flush()
file.bufferedWriter().close()
anything wrong ? thanks, canal
On Saturday, August 15, 2015 11:21 AM, Brandon White
<[email protected]> wrote:
Convert it to a rdd then save the rdd to a file
val str = "dank memes"sc.parallelize(List(str)).saveAsTextFile("str.txt")
On Fri, Aug 14, 2015 at 7:50 PM, go canal <[email protected]> wrote:
Hello again,online resources have sample code for writing RDD to a file, but I
have a simple string, how to save to a text file ? (my data is a DenseMatrix
actually)
appreciate any help ! thanks, canal