Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input / Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
    • Multimodal Expressions
  • PyFlink Multimodal
  • PyFlink Table
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.DataFrame.iter_batches#

DataFrame.iter_batches(*, batch_size: int = '1000', batch_format: Literal['pandas'] = "'pandas'") → Iterator['pd.DataFrame'][source]#
DataFrame.iter_batches(*, batch_size: int = '1000', batch_format: Literal['arrow']) → Iterator['pa.Table']

Return an iterator of pandas DataFrames or PyArrow Tables.

This is a terminal operation that triggers execution. It uses Arrow-based serialization for efficient data transfer. In streaming mode, the DataFrame must produce append-only rows.

Parameters
  • batch_size – The maximum number of rows per batch. Defaults to 1000.

  • batch_format – Batch result format, either “pandas” or “arrow”.

Returns

A closeable iterator that yields pandas DataFrames or PyArrow Tables.

Example::
>>> df = pf.from_records([(i,) for i in range(2500)], schema=["a"])
>>> for batch in df.iter_batches(batch_size=1000):
...     print(len(batch))
1000
1000
500

previous

pyflink.dataframe.DataFrame.iter_rows

next

pyflink.dataframe.DataFrame.explain

Show Source

Created using Sphinx 4.5.0.