You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by "Papadopoulos, Konstantinos" <Ko...@IRIworldwide.com> on 2019/05/06 14:31:03 UTC
writeAsFormattedText sets only Unix/Linux line endings
Hi all,
We are developing an application using Flink DataSet API focusing on generating a CSV file from a dataset of POJOs using writeAsFormattedText and a custom TextFormatter.
During the testing of our application, we observed that the files generated consist of Unix line endings (i.e., '\n') even if the execution environment is Windows (i.e., expected line endings '\r\n').
Since this is critical to our solution, is there any way to configure the line endings of the files generated?
Thanks in advance,
Konstantinos
Re: writeAsFormattedText sets only Unix/Linux line endings
Posted by Chesnay Schepler <ch...@apache.org>.
The line-ending is hard-coded into the TextOutputFormat. You will have
to either extend this class and override #writeRecord(), or convert your
POJOs to a Tuple and use the CsvOutputFormat, which supports setting the
line delimiter (called recordDelimiter).
On 09/05/2019 08:32, Papadopoulos, Konstantinos wrote:
>
> Kind reminder
>
> *From:*Papadopoulos, Konstantinos
> <Ko...@IRIworldwide.com>
> *Sent:* Monday, May 06, 2019 5:31 PM
> *To:* user@flink.apache.org
> *Subject:* writeAsFormattedText sets only Unix/Linux line endings
>
> Hi all,
>
> We are developing an application using Flink DataSet API focusing on
> generating a CSV file from a dataset of POJOs using
> writeAsFormattedText and a custom TextFormatter.
>
> During the testing of our application, we observed that the files
> generated consist of Unix line endings (i.e., ā\nā) even if the
> execution environment is Windows (i.e., expected line endings ā\r\nā).
>
> Since this is critical to our solution, is there any way to configure
> the line endings of the files generated?
>
> Thanks in advance,
>
> Konstantinos
>
RE: writeAsFormattedText sets only Unix/Linux line endings
Posted by "Papadopoulos, Konstantinos" <Ko...@IRIworldwide.com>.
Kind reminder
From: Papadopoulos, Konstantinos <Ko...@IRIworldwide.com>
Sent: Monday, May 06, 2019 5:31 PM
To: user@flink.apache.org
Subject: writeAsFormattedText sets only Unix/Linux line endings
Hi all,
We are developing an application using Flink DataSet API focusing on generating a CSV file from a dataset of POJOs using writeAsFormattedText and a custom TextFormatter.
During the testing of our application, we observed that the files generated consist of Unix line endings (i.e., '\n') even if the execution environment is Windows (i.e., expected line endings '\r\n').
Since this is critical to our solution, is there any way to configure the line endings of the files generated?
Thanks in advance,
Konstantinos