Importing spark.implicits._ in scala

前端 未结 8 1131
感情败类
感情败类 2020-12-25 09:33

I am trying to import spark.implicits._ Apparently, this is an object inside a class in scala. when i import it in a method like so:

def f() = {
  val spark          


        
8条回答
  •  醉梦人生
    2020-12-25 10:19

    I just instantiate SparkSession and before to use, "import implicits".

    @transient lazy val spark = SparkSession
      .builder()
      .master("spark://master:7777")
      .getOrCreate()
    
    import spark.implicits._
    

提交回复
热议问题