You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Lydia Ickler <ic...@googlemail.com> on 2015/10/07 21:35:32 UTC
writeAsCsv
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
Re: writeAsCsv
Posted by Lydia Ickler <ic...@googlemail.com>.
ok, thanks! :)
I will try that!
> Am 07.10.2015 um 21:35 schrieb Lydia Ickler <ic...@googlemail.com>:
>
> 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
>
Re: writeAsCsv
Posted by Robert Schmidtke <ro...@gmail.com>.
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 <ic...@googlemail.com>
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