Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
    • StreamExecutionEnvironment
    • DataStream
    • Functions
    • State
    • Timer
    • Window
    • Checkpoint
    • Side Outputs
    • Connectors
    • Formats
  • PyFlink Common

pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment.read_text_file#

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.

Parameters
  • 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.

Returns

The DataStream that represents the data read from the given file as text lines.

previous

pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment.from_source

next

pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment.from_collection

Show Source

Created using Sphinx 4.5.0.