Reputation: 9
My goal is joining 3 tables in Pyspark dataframes,
TableA
, TableB
and TableC
all have an ID like a Key to merge.
I want to join three tables and create a new Pyspark dataframe.
Do you have any suggestions?
Upvotes: 0
Views: 616
Reputation: 350
You can simply join them as below:
final_table = (tableA.join(tableB, on = [tableA.ID == tableB.ID], how = 'inner')
.join(tableC, on = [tableA.ID == tableB.ID], how = 'inner'))
Upvotes: 1