cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Muliple Where condition vs AND && in Pyspark

User16826994223
Honored Contributor III

.where((col('state')==state) & (col('month')>startmonth)

I can do the where conditions both ways. I think the one below add readability. Is there any other difference and which is the best?

.where(col('state')==state)

.where(col('month')>startmonth)

1 REPLY 1

User16826994223
Honored Contributor III

You can use explain to see what type of physical and logical plans are getting created . This is the best way to see difference , but as mentioned in the question , it should give the same physical plan

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