ANKIT JHA
ANKIT JHA

Reputation: 359

Error while instantiating 'org.apache.spark.sql.hive.HiveSessionState':"

While printing the schema of a SQL database,I am getting the following error:

Upvotes: 1

Views: 5107

Answers (1)

Ekaba Bisong
Ekaba Bisong

Reputation: 2982

Use SparkSession instead of SQLContext. So do:

sqlContext = SparkSession.builder.master("local[*]").appName("appName").
                      config("spark.sql.warehouse.dir", "./spark-warehouse").getOrCreate()

The rest of your code should work normally.
You may adjust the variable name from sqlContext to reflect the reference held.

Upvotes: 2

Related Questions