You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Vishwas Siravara <vs...@gmail.com> on 2019/08/01 15:49:46 UTC
Streaming from a file
Hi guys,
Is it possible for flink to stream from a unix file system line by line,
when I use readTextFile(path) - Reads text files, i.e. files that respect
the TextInputFormat specification, line-by-line and returns them as Strings.
The entire contents of the file comes as a datastream, over which I can
iterate to extract each line as a string. Is it possible to stream a line
at a time ? Thanks for all the help so far.
Thanks,
Vishwas
Re: Streaming from a file
Posted by Zhu Zhu <re...@gmail.com>.
Hi Vishwas,
Not sure whether I understand your needs correctly.
I think currently readTextFile(path) does return a DataStream<String>. From
the code it is emitting one line once it is read from the file, thus in a
line-by-line streaming pattern.
Thanks,
Zhu Zhu
Vishwas Siravara <vs...@gmail.com> 于2019年8月1日周四 下午11:50写道:
> Hi guys,
> Is it possible for flink to stream from a unix file system line by line,
> when I use readTextFile(path) - Reads text files, i.e. files that respect
> the TextInputFormat specification, line-by-line and returns them as
> Strings.
> The entire contents of the file comes as a datastream, over which I can
> iterate to extract each line as a string. Is it possible to stream a line
> at a time ? Thanks for all the help so far.
>
>
> Thanks,
> Vishwas
>