cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Lazy evaluation in serverless vs all purpose compute ?

aniket07
New Contributor II

aniket07_0-1744691152378.png

aniket07_1-1744691251247.png

aniket07_2-1744691310065.png

As you can see right now I am connected to serverless compute and when I give wrong path, spark does lazy evaluation and gives error on display. 
However, when I switch from serverless to my all purpose cluster I get the error when I create the df itself.
Why is that?

2 REPLIES 2

SP_6721
Contributor

Hi @aniket07 

With Serverless compute, Spark uses lazy evaluation and only checks if the path exists when you perform an action (like display()), so the error appears then. On the other hand, in All-Purpose clusters, Spark checks the path immediately when you create the DataFrame, so you see the error right away.

This difference is due to how each environment handles path validation and when they access storage.

sridharplv
Contributor

Based on the scenario, what https://community.databricks.com/t5/user/viewprofilepage/user-id/156441 saying is correct though the eager evaluation property is false in both cases and for All-Purpose clusters, Spark is checking the path immediately when you create the DataFrame.

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