Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

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

pyflink.dataframe.DataFrame.limit#

DataFrame.limit(n: int) → pyflink.dataframe.dataframe.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.collect

next

pyflink.dataframe.DataFrame.offset

Show Source

Created using Sphinx 4.5.0.