df2.withColumn("cid", regexp_replace(df2("cid"), "\"", ""))
trentyid | cid
----------+----------
a | 1, 5, 16
b | 76, 34
Both trendyid
and cid
are string columns.
df3.select($"trentyid".as("trentyid"), explode(split($"cid", ",")).as("cid1"))
Output:
trentyid | cid1
----------+----------
a |
b |
This last line seems to not work as expected, as the second column is empty.
What could the cause of that be?