spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SK <>
Subject save a histogram to a file
Date Fri, 23 Jan 2015 00:07:24 GMT
histogram() returns an object that is a  pair of Arrays. There appears to be
no saveAsTextFile() for this paired object.

Currently I am using the following to save the output to a file:

val hist = a.histogram(10)

val arr1 = sc.parallelize(hist._1).saveAsTextFile("file1")
val arr2 = sc.parallelize(hist._2).saveAsTextFile("file2")

Is there a simpler way to save the histogram() result to a file?


View this message in context:
Sent from the Apache Spark User List mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message