Dataset

Empty

val df = Seq.empty[Apple].toDS()

From list

List(Apple("green", 70), Apple("red", 110)).toDS()

From DataFrame

List(("green", 70)).toDF("color", "weight")
  .as[Apple]

Example: DataSetCreationSpec.scala