You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Flavio Pompermaier <po...@okkam.it> on 2015/04/17 17:03:59 UTC

CSV header management

Hi guys,
how can I read a csv but keeping the header in  some variable without
throwing it away?

Thanks in advance,
Flavio

Re: CSV header management

Posted by Robert Metzger <rm...@apache.org>.
Yes, using a map() function that is transforming the input lines into the
String array.

On Fri, Apr 17, 2015 at 9:03 PM, Flavio Pompermaier <po...@okkam.it>
wrote:

> My csv has 32 columns,ia there a way to create a Dataset<String[32]>?
> On Apr 17, 2015 7:53 PM, "Stephan Ewen" <se...@apache.org> wrote:
>
>> I don't think there is any built-in functionality for that.
>>
>> You can probably read the header with some custom code (in the driver
>> program) and use the CSV reader (skipping the header) as a regular data
>> source.
>>
>> On Fri, Apr 17, 2015 at 5:03 PM, Flavio Pompermaier <pompermaier@okkam.it
>> > wrote:
>>
>>> Hi guys,
>>> how can I read a csv but keeping the header in  some variable without
>>> throwing it away?
>>>
>>> Thanks in advance,
>>> Flavio
>>>
>>
>>

Re: CSV header management

Posted by Flavio Pompermaier <po...@okkam.it>.
My csv has 32 columns,ia there a way to create a Dataset<String[32]>?
On Apr 17, 2015 7:53 PM, "Stephan Ewen" <se...@apache.org> wrote:

> I don't think there is any built-in functionality for that.
>
> You can probably read the header with some custom code (in the driver
> program) and use the CSV reader (skipping the header) as a regular data
> source.
>
> On Fri, Apr 17, 2015 at 5:03 PM, Flavio Pompermaier <po...@okkam.it>
> wrote:
>
>> Hi guys,
>> how can I read a csv but keeping the header in  some variable without
>> throwing it away?
>>
>> Thanks in advance,
>> Flavio
>>
>
>

Re: CSV header management

Posted by Stephan Ewen <se...@apache.org>.
I don't think there is any built-in functionality for that.

You can probably read the header with some custom code (in the driver
program) and use the CSV reader (skipping the header) as a regular data
source.

On Fri, Apr 17, 2015 at 5:03 PM, Flavio Pompermaier <po...@okkam.it>
wrote:

> Hi guys,
> how can I read a csv but keeping the header in  some variable without
> throwing it away?
>
> Thanks in advance,
> Flavio
>