Skip to content

Instantly share code, notes, and snippets.

@raidery
Created December 19, 2019 09:20
Show Gist options
  • Save raidery/dfdaae2b2dc2a3bc272b837e7d1a3567 to your computer and use it in GitHub Desktop.
Save raidery/dfdaae2b2dc2a3bc272b837e7d1a3567 to your computer and use it in GitHub Desktop.
Extract column values of Dataframe as List in Apache Spark
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