Skip to content

Instantly share code, notes, and snippets.

@khajavi
Created June 18, 2016 09:52
Show Gist options
  • Save khajavi/25767f82209dab0743f248cc44666354 to your computer and use it in GitHub Desktop.
Save khajavi/25767f82209dab0743f248cc44666354 to your computer and use it in GitHub Desktop.
Base Model Apache Spark
trait BaseTrait extends Product with Serializable
case class AT(name: String) extends BaseTrait
case class BT(age: Int) extends BaseTrait
val listA = AT("a1") :: AT("a2") :: Nil
val listB = BT(1) :: BT(2) :: Nil
val list = listA ++ listB
val res = sc.parallelize(list.toSeq).toDS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment