title: Error instantiating 'org.apache.spark.sql.hive.HiveSessionState': on Linux server
body: <p>I have a Scala Spark application that I'm trying to run on a Linux server using a shell script. I am getting the error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalArgumentException: Error
    while instantiating 'org.apache.spark.sql.hive.HiveSessionState':</p>
  </blockquote>
  
  <p>However, I don't understand what is wrong. I am doing this to instantiate Spark:</p>
  
  <pre><code>val sparkConf = new SparkConf().setAppName("HDFStoES").setMaster("local")
  
        val spark: SparkSession = SparkSession.builder.enableHiveSupport().config(sparkConf).getOrCreate()
  </code></pre>
  
  <p>Am I doing this correctly, if so what could be the error?</p>