0

Normally in Scala if you invoke toDS() on a sequence, you get:

error: value toDS is not a member of Seq[Int]

However, in a SparkSession, you can invoke the same method on a Seq and it creates a DataSet.

How is this MetaProgramming actually happening?

More Than Five
  • 9,959
  • 21
  • 77
  • 127

1 Answers1

2

It comes from SparkSession.implicits:

import org.apache.spark.sql.SparkSession

val spark = SparkSession.builder.getOrCreate()
import spark.implicits._