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,311
  • 20
  • 72
  • 121

1 Answers1

2

It comes from SparkSession.implicits:

import org.apache.spark.sql.SparkSession

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