view raw
dreddy dreddy - 7 months ago 43
Scala Question

scala add a string in the mapper

Hi I have the following code that gets each column and produces a string separated by commas.

val selectCols = c => cmap.getOrElse(,",")

Output: store_id,date_id,user_id,data,other_column

But I would like to modify this map function to get the following string:


Any help is appreciated.

val selectCols    = c => cmap.getOrElse(,
.map(c => s"t.$c")