Skip to content

Instantly share code, notes, and snippets.

@ryandavidhartman
Created August 3, 2017 20:17
Show Gist options
  • Save ryandavidhartman/b0614b93b52989168028a7b98aa3f185 to your computer and use it in GitHub Desktop.
Save ryandavidhartman/b0614b93b52989168028a7b98aa3f185 to your computer and use it in GitHub Desktop.
val data = Map(("a" -> Some(1)), ("b" -> None), ("c" -> 1), ("d" -> "dfd"))
val test1 = data.filter({case (key, value) => value != None}).collect {
case (key, Some(value)) => key -> value
case (key, value) => key -> value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment