How to handle this scenario in spark? [closed]

Join both datasets based on company_id and select all columns from second dataset. Code should look something as below: (Not Tested)

Dataset<Row> finalDf = firstDataset.join(secondDataset 
,firstDataset.col("companyId").equalTo(secondDataset.col("companyid"), 
"inner").select(secondDataset .col("*))
finalDF.show()

Leave a Comment