cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to limit number rows to display using display method in Spark databricks notebook ?

ramravi
Contributor II
 
2 REPLIES 2

Ajay-Pandey
Esteemed Contributor III

@Ravi Tejaโ€‹ you can use limit() function to limit the number of row

You can refer below code -

data_frame.limit(10).display()

Ajay Kumar Pandey

Rishabh-Pandey
Esteemed Contributor

hey @Ravi Tejaโ€‹ there is two methods by which we can limit our datafame , by using take and limit .

refer this concept

myDataFrame.take(10)

-> results in an Array of Rows. This is an action and performs collecting the data (like collect does).

myDataFrame.limit(10)

-> results in a new Dataframe. This is a transformation and does not perform collecting the data.

Rishabh Pandey

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group