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