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: 

DBR 14.1 Pyspark Join on df1["col1"] = df2["col1"] syntax fails

Trifa
New Contributor II

Hello
After upgrading my cluster from DBR 12 to 14.1 I got a MISSING_ATTRIBUTES.RESOLVED_ATTRIBUTE_APPEAR_IN_OPERATION on some of my Joins

df1.join(
    df2,
    [df1["name"] == df2["name"], df1["age"] == df2["age"]],
    'left_outer'
)

I resolved it by changing the syntax to:

df1.alias("l").join(
    df2.alias("r"),
    [col("l.name") == col("r.name"), col("l.age"]) == col("r.age")],
    'left_outer'
)

Is the second syntax the new standard or am I missing something with the first one ?

Thanks

0 REPLIES 0

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