sqlContext is not available


#1

Hi,

sqlContext is not avaiable in Spark 2.

Please help me.


#2

@kukutlakumar

In Spark 2.0.x, the starting point of Spark is SparkSession and that is available in Spark shell as spark, you can try below way:

spark.sqlContext.sql(…)
You can also create your Spark Context like this

val sqlContext = new org.apache.spark.sql.SQLContext(sc)


#3

Thanks,I can create the sqlContext by your mentioned way.

So in Spark 2 by default sqlContext is not available.We have to create explicitly always.
Correct me if I am wrong.


#4

Yes from spark 2.0.X versions sqlContext is not directly available