Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Unable to save data from Spark into Hive

Solved Go to solution
Highlighted

Unable to save data from Spark into Hive

Rising Star

Hi,

Trying to complete Lab 4 (Riskfactor Analysis with Spark), i got the following error for the last instruction:

%spark hiveContext.sql("create table riskfactor as select * from finalresults")

<console>:28: error: not found: value hiveContext

hiveContext.sql("create table riskfactor as select * from finalresults")

^

Any idea please?

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Unable to save data from Spark into Hive

Rising Star

Did u run the import and initialization of hive context like below ?

import org.apache.spark.sql.hive.orc._
import org.apache.spark.sql._

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

If you still face issues, check if hive is running.

View solution in original post

2 REPLIES 2

Re: Unable to save data from Spark into Hive

Rising Star

Did u run the import and initialization of hive context like below ?

import org.apache.spark.sql.hive.orc._
import org.apache.spark.sql._

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

If you still face issues, check if hive is running.

View solution in original post

Highlighted

Re: Unable to save data from Spark into Hive

Rising Star

Now it works fine thank you.

Don't have an account?
Coming from Hortonworks? Activate your account here