flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Hueske <fhue...@gmail.com>
Subject Re: Get 1 element of DataSet
Date Thu, 05 Feb 2015 14:46:43 GMT
Have a look at "broadcast values/sets".

Not sure if that solves you problem, but you could do:

DataSet<String> stringSet = ...
DataSet<String> first = stringSet.first();

DataSet myNewSet = stringSet.map(myMapFnc).withBroadcastSet(first,"first
value");

This distributes the first DataSet to all Mapper functions and you can read
and use the value.

Cheers, Fabian

2015-02-05 15:34 GMT+01:00 Vinh June <hoangthevinh.htv@gmail.com>:

> Hi Stefan,
>
> DataSet.first(n) produces a child DataSet, while I need the element
>
> Specifically, I have a CSV with header line and I want to make the maps of
> each (header,value) pair for each line
>
>
>
> --
> View this message in context:
> http://apache-flink-incubator-user-mailing-list-archive.2336050.n4.nabble.com/Get-1-element-of-DataSet-tp688p692.html
> Sent from the Apache Flink (Incubator) User Mailing List archive. mailing
> list archive at Nabble.com.
>

Mime
View raw message