Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
    • StreamExecutionEnvironment
    • DataStream
    • Functions
    • State
    • Timer
    • Window
    • Checkpoint
    • Side Outputs
    • Asynchronous I/O
    • Connectors
    • Formats
  • PyFlink DataFrame
  • PyFlink Common
  • API Reference
  • PyFlink DataStream
  • StreamExecutionEnvironment
  • pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment.read_text_file

pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment.read_text_file#

StreamExecutionEnvironment.read_text_file(file_path: str, charset_name: str = 'UTF-8') → 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

On this page
  • StreamExecutionEnvironment.read_text_file()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.