Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val stringify = udf((vs: Seq[String]) => vs.mkString(";"))
groupedKvKRecords
.map(
r => r.kvkRecords
.foldRight((0, 0, List.empty[String]))(
(kvkrecord, comb) => (
comb._1 + 1,
kvkrecord.wptf + comb._2,
kvkrecord.dossierNummer :: comb._3
)
)
)
.toDF("num", "wfte", "dossiernummersArray")
.select(
'num,
'wfte,
stringify('dossiernummersArray).as("dossiernummers")
)
.repartition(1)
.write.mode(SaveMode.Overwrite).option("header", true).option("sep", ";").option("quote", "").option("nullValue", "").option("mode", "FAILFAST")
.csv(Config.targetDataFile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.