Say I have df1 as this:
var df1 = Seq("a","b","c","d").toDF("letter")
and df2 as this:
var df2 = Seq(("a","1"),("q","2"),("x","c"),("d","z")).toDF("col1","col2")
I want to merge the two so that it returns the rows where EITHER col1 or col2 of df2 match the corresponding row of df1.
So the resulting dataframe should look like this:
(Since row 2 of df2 doesn't have a "b" in it, it isn't returned in the resulting dataframe)
Thanks so much, have a great day and a happy new year!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…