cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
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()

Rishabh264
Honored Contributor II

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.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.