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
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • DataFrame
  • pyflink.dataframe.dataframe.DataFrame.limit

pyflink.dataframe.dataframe.DataFrame.limit#

DataFrame.limit(n: int) → DataFrame[source]#

Limit the DataFrame to the first n rows.

This is a lazy transformation that returns a new DataFrame.

Parameters:

n – The maximum number of rows to return. Must be non-negative.

Returns:

A new DataFrame limited to at most n rows.

Example:

>>> df = pf.from_records([(1,), (2,), (3,)], schema=["a"])
>>> df.limit(2).collect()
[Row(a=1), Row(a=2)]

previous

pyflink.dataframe.dataframe.DataFrame.pipe

next

pyflink.dataframe.dataframe.DataFrame.offset

On this page
  • DataFrame.limit()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.