for example:there are a dataframe like:
val df2 = sc.parallelize(List((1, "A|B"), (1, "C|D"), (2, "E|A"), (2, "S|D")))
.toDF("key1","key2")
Now I want to split the column "key2" to two column. The each row of the result will be showed like that:
1 "A" "B"
What should I code ? Thx!