pyflink.table.Table.fetch#
- Table.fetch(fetch: int) pyflink.table.table.Table [source]#
Limits a (possibly sorted) result to the first n rows.
This method can be combined with a preceding
order_by()
call for a deterministic order andoffset()
call to return n rows after skipping the first o rows.Example:
Returns the first 3 records.
>>> tab.order_by(col('name').desc).fetch(3)
Skips the first 10 rows and returns the next 5 rows.
>>> tab.order_by(col('name').desc).offset(10).fetch(5)
- Parameters
fetch – The number of records to return. Fetch must be >= 0.
- Returns
The result table.