From https://spark.apache.org/docs/1.5.1/api/java/org/apache/spark/sql/DataFrame.html, use join
:
Inner equi-join with another DataFrame using the given column.
PersonDf.join(ProfileDf,$"personId")
OR
PersonDf.join(ProfileDf,PersonDf("personId") === ProfileDf("personId"))
Update:
You can also save the DFs
as temp table using df.registerTempTable("tableName")
and you can write sql queries using sqlContext
.