0

my SPARK version is spark--version : 2.3.2. while importing

import sqlContext.implicits

i am getting error : cannot resolve symbol sqlcontext

i am using Intellij and scala Scala version 2.11.8

Kindly share your thoughts.

OMG
  • 243
  • 2
  • 3
  • 12

2 Answers2

4

The import you're trying will not work because the object is defined within the class SQLContext

val sqlContext = new SQLContext(sc)
import sqlContext.implicits._

Take a look at Why import implicit SqlContext.implicits._ after initializing SQLContext in a scala spark application

Hope this helps!

Abhinandan Dubey
  • 655
  • 2
  • 9
  • 15
0

You have to create the sqlContext object first from the SQLContext, see https://spark.apache.org/docs/2.3.0/api/java/org/apache/spark/sql/SQLContext.implicits$.html. Otherwise, as it says, it doesn't know about such an objectl

Frank
  • 88
  • 2
  • 10