- StreamExecutionEnvironment.read_text_file(file_path: str, charset_name: str = 'UTF-8') pyflink.datastream.data_stream.DataStream [source]#
Reads the given file line-by-line and creates a DataStream that contains a string with the contents of each such line. The charset with the given name will be used to read the files.
Note that this interface is not fault tolerant that is supposed to be used for test purpose.
file_path – The path of the file, as a URI (e.g., “file:///some/local/file” or “hdfs://host:port/file/path”)
charset_name – The name of the character set used to read the file.
The DataStream that represents the data read from the given file as text lines.