Skip to content

Instantly share code, notes, and snippets.

@raidery
Created December 19, 2019 09:19
Show Gist options
  • Save raidery/e74946d8433b4f1e89d35169eb0fcb71 to your computer and use it in GitHub Desktop.
Save raidery/e74946d8433b4f1e89d35169eb0fcb71 to your computer and use it in GitHub Desktop.
Extract column values of Dataframe as List in Apache Spark.scala
df.collect().foreach(row => row.toSeq.foreach(col => {
col match {
case n: Number => println(col)
case _ => None
}
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment