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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now