spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ishwardeep Singh <ishwardeep.si...@impetus.co.in>
Subject Re: Loading already existing tables in spark shell
Date Tue, 25 Aug 2015 08:23:12 GMT
Hi Jeetendra,



Please try the following in spark shell. it is like executing an sql command.



sqlContext.sql("use <database name>")



Regards,

Ishwardeep

________________________________
From: Jeetendra Gangele <gangele397@gmail.com>
Sent: Tuesday, August 25, 2015 12:57 PM
To: Ishwardeep Singh
Cc: user
Subject: Re: Loading already existing tables in spark shell

In spark shell "use database " not working saying use not found in the shell?
did you ran this with scala shell ?

On 24 August 2015 at 18:26, Ishwardeep Singh <ishwardeep.singh@impetus.co.in<mailto:ishwardeep.singh@impetus.co.in>>
wrote:

Hi Jeetendra,


I faced this issue. I did not specify the database where this table exists. Please set the
database by using "use <database>" command before executing the query.


Regards,

Ishwardeep


________________________________
From: Jeetendra Gangele <gangele397@gmail.com<mailto:gangele397@gmail.com>>
Sent: Monday, August 24, 2015 5:47 PM
To: user
Subject: Loading already existing tables in spark shell

Hi All I have few tables in hive and I wanted to run query against them with spark as execution
engine.

Can I direct;y load these tables in spark shell and run query?

I tried with
1.val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
2.qlContext.sql("FROM event_impressions select count(*)") where event_impressions is the table
name.

It give me error saying "org.apache.spark.sql.AnalysisException: no such table event_impressions;
line 1 pos 5"

Does anybody hit similar issues?


regards
jeetendra

________________________________






NOTE: This message may contain information that is confidential, proprietary, privileged or
otherwise protected by law. The message is intended solely for the named addressee. If received
in error, please destroy and notify the sender. Any use of this email is prohibited when received
in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this
communication has been maintained nor that the communication is free of errors, virus, interception
or interference.

________________________________






NOTE: This message may contain information that is confidential, proprietary, privileged or
otherwise protected by law. The message is intended solely for the named addressee. If received
in error, please destroy and notify the sender. Any use of this email is prohibited when received
in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this
communication has been maintained nor that the communication is free of errors, virus, interception
or interference.

Mime
View raw message