1

Input Table A

catgId1 catg id2    catg id3    catg id4    catg id5
123     456          789            1011    1213

Table B

catgId
123
456
789
1011
1213

Output:Need to join two tables I tried like

val results = df1.join(broadcast(df2),Array("catg Id").toSeq,"left_outer")
                 .join(broadcast(df2),Array("catg Id").toSeq,"left_outer")

Like this i tried 5 times renaming the column and i joined. Is there any better way apart from this. Please suggest.

Re queried output joining of two table i need few more columns i didn't mention here.

mallu
  • 23
  • 7
  • 1
    It is not clear what you need here. Please [edit] the question to provide more details. See [How to make good reproducible Apache Spark Dataframe examples](https://stackoverflow.com/q/48427185/8371915) – Alper t. Turker Jun 04 '18 at 09:43

0 Answers0