Lets take the following toy problem, I've got the following case classes:

case class Order(id: String, name: String, status: String) case class TruncatedOrder(id: String) case class Org(name: String, ord: Seq[TruncatedOrder])

I've now got the following defined variables

val ordersDF = Seq(Order("or1", "stuff", "shipped"), Order("or2", "thigns", "delivered") , Order("or3", "thingamabobs", "never received"), Order("or4", "???", "what?")).toDS() val orgsDF = Seq(Org("tupper", Seq(TruncatedOrder("or1"), TruncatedOrder("or2"), TruncatedOrder("or3"))), Org("ware", Seq(TruncatedOrder("or3"), TruncatedOrder("or4")))).toDS()

What I would like is to have for example a datapoint that looks as follows

Ord("tupper", Array(Joined("or1", "stuff", "shipped"), Joined("or2", "things", "delivered"), ...)