I have a sequence of a case class, which has a String followed by a sequence of Strings. How do I flatmap the sequence of Strings (second column) without losing the first column?
I tried this:
flatmap(_.second)
But in this case I lose the first column.
Here is my code:
case class A(
first:String,
second:Seq[String]
)
val ds = Seq(
A("1", Seq("A","B")),
A("2", Seq("C"))
) toDS