writeAsCsv

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

writeAsCsv

Lydia Ickler
Hi, 

stupid question: Why is this not saved to file?
I want to transform an array to a DataSet but the Graph stops at collect().

//Transform Spectrum to DataSet
List<Tuple2<String, String>> dataList = new LinkedList<Tuple2<String, String>>();
double[][] arr = filteredSpectrum.getAs2DDoubleArray();
for (int i=0;i<arr[0].length;i++) {
dataList.add(new Tuple2( arr[0][i], arr[1][i]));
}
env.fromCollection(dataList).writeAsCsv(output);
Best regards, 
Lydia

Reply | Threaded
Open this post in threaded view
|

Re: writeAsCsv

Robert Schmidtke
Hi, as far as I know only collect, print and execute actually trigger the execution. What you're missing is env.execute() after the writeAsCsv call. Hope this helps.

On Wed, Oct 7, 2015 at 9:35 PM, Lydia Ickler <[hidden email]> wrote:
Hi, 

stupid question: Why is this not saved to file?
I want to transform an array to a DataSet but the Graph stops at collect().

//Transform Spectrum to DataSet
List<Tuple2<String, String>> dataList = new LinkedList<Tuple2<String, String>>();
double[][] arr = filteredSpectrum.getAs2DDoubleArray();
for (int i=0;i<arr[0].length;i++) {
dataList.add(new Tuple2( arr[0][i], arr[1][i]));
}
env.fromCollection(dataList).writeAsCsv(output);
Best regards, 
Lydia




--
My GPG Key ID: 336E2680
Reply | Threaded
Open this post in threaded view
|

Re: writeAsCsv

Lydia Ickler
In reply to this post by Lydia Ickler
ok, thanks! :)

I will try that!



Am 07.10.2015 um 21:35 schrieb Lydia Ickler <[hidden email]>:

Hi, 

stupid question: Why is this not saved to file?
I want to transform an array to a DataSet but the Graph stops at collect().

//Transform Spectrum to DataSet
List<Tuple2<String, String>> dataList = new LinkedList<Tuple2<String, String>>();
double[][] arr = filteredSpectrum.getAs2DDoubleArray();
for (int i=0;i<arr[0].length;i++) {
dataList.add(new Tuple2( arr[0][i], arr[1][i]));
}
env.fromCollection(dataList).writeAsCsv(output);
Best regards, 
Lydia