Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +---+
- | tt|
- +---+
- | a|
- | b|
- | c|
- | ab|
- +---+
- +----+-----+------+
- |name|alter|profit|
- +----+-----+------+
- | a| aa| 1|
- | b| a| 5|
- | c| ab| 8|
- +----+-----+------+
- dataDF = dataDF.select("*")
- .join(broadcast(alterDF),
- col("tt") === col("Name") || col("tt") === col("alter"),
- "left")
- +---+----+-----+------+
- | tt|name|alter|profit|
- +---+----+-----+------+
- | a| a| aa| 1|
- | a| b| a| 5| // this row is not expected.
- | b| b| a| 5|
- | c| c| ab| 8|
- | ab| c| ab| 8|
- +---+----+-----+------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement