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
    • TableEnvironment
    • Table
    • Data Types
    • Window
    • Expressions
    • User Defined Functions
    • Descriptors
    • StatementSet
    • Catalog
  • PyFlink DataStream
  • PyFlink DataFrame
  • PyFlink Common
  • API Reference
  • PyFlink Table
  • Expressions
  • pyflink.table.expression.Expression.fetch_content

pyflink.table.expression.Expression.fetch_content#

Expression.fetch_content(concurrency=None) → Expression[source]#

Asynchronously fetches content from the given URI (HTTP, OSS, HDFS, S3, etc.) and returns as VARBINARY. This is the recommended variant that uses async I/O to avoid blocking the operator thread, which is beneficial for high-throughput scenarios such as multi-modal inference pipelines.

Retries are handled by the framework-level async retry strategy, not by this function. Configure table.exec.async-scalar.retry-strategy and related options.

Supported URI schemes: - http:// or https:// - HTTP/HTTPS URLs - oss:// - Alibaba Cloud OSS - hdfs:// - HDFS - file:// - Local file system - s3:// or s3a:// - AWS S3

Parameters:

concurrency – Optional. The number of concurrent fetch operations per operator instance. Must be a literal integer constant. Defaults to max(8, num of cpu cores).

Example usage:

>>> from pyflink.table import EnvironmentSettings, TableEnvironment
>>> from pyflink.table.expressions import col
>>> # Async download is non-blocking and improves throughput for I/O-heavy workloads
>>> result = table.select(col("id"), col("uri").fetch_content())
>>> # With explicit concurrency
>>> result = table.select(col("id"), col("uri").fetch_content(64))
Returns:

A VARBINARY (bytes) representing the file content.

Added in version 1.12.0.

previous

pyflink.table.expression.Expression.mime_type

next

pyflink.table.expression.Expression.to_date

On this page
  • Expression.fetch_content()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.