Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

HiveContext: cannot resolve constructor

Trying to build a hivecontext following others' examples, and I have tried both:

import org.apache.spark.sql.hive.HiveContext

val spark = SparkSession
      .builder.master("local[4]")
      .appName("SpeedTester")
      .config("spark.driver.memory", "3g")
      .enableHiveSupport()
      .getOrCreate()

val hiveContext = new org.apache.spark.sql.hive.HiveContext(spark)

and

import org.apache.spark.sql.hive.HiveContext

val spark = SparkSession
      .builder.master("local[4]")
      .appName("SpeedTester")
      .config("spark.driver.memory", "3g")
      .enableHiveSupport()
      .getOrCreate()

val hiveContext =  new HiveContext(spark)

But the IntelliJ always says 'cannot resolve constructor'

I have added the maven dependency in my pom file:

      <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-hive_2.11</artifactId>
          <scope>provided</scope>
          <version>2.3.0</version>
      </dependency>

Why could this happen and how to address this issue?

Any help is appreciated.

Comments