pyflink.dataframe.DataFrame.iter_rows#
- DataFrame.iter_rows(*, include_row_kind: bool = False, row_kind_field: str = '__row_kind__') Iterator[Dict[str, Any]][source]#
Return an iterator over rows of the DataFrame.
This is a terminal operation that triggers execution.
- Parameters
include_row_kind – If True, include the Flink changelog row kind in each row dictionary.
row_kind_field – Field name for row kind when include_row_kind is True.
- Returns
A closeable iterator that yields rows as dictionaries.
- Example::
>>> df = pf.from_records([(1, "a"), (2, "b")], schema=["id", "name"]) >>> for row in df.iter_rows(): ... print(row) {'id': 1, 'name': 'a'} {'id': 2, 'name': 'b'}