spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <mich.talebza...@gmail.com>
Subject Re: Unable to see external table that is created from Hive Context in the list of hive tables
Date Thu, 18 Aug 2016 22:47:27 GMT
Which Hive database did you specify in your CREATE EXTERNAL TABLE statement?

How did you specify the location of the file?

This one creates an external table testme in database test in the location
under database test

scala>  sqltext = """
     |  CREATE EXTERNAL TABLE test.testme (
     | col1 int
     | )
     | STORED AS ORC
     | LOCATION '/user/hive/warehouse/test.db/testme'
     | """
sqltext: String =
 CREATE EXTERNAL TABLE test.testme (
col1 int
)
STORED AS ORC
LOCATION '/user/hive/warehouse/test.db/testme'
scala> sql(sqltext)
res18: org.apache.spark.sql.DataFrame = []

scala> sql("select count(1) from test.testme").show
+--------+
|count(1)|
+--------+
|       0|
+--------+

And you can see it in Hive as well

hive> desc test.testme;
OK
col1                    int
Time taken: 0.102 seconds, Fetched: 1 row(s)

HTH

Dr Mich Talebzadeh



LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com


*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.



On 18 August 2016 at 23:08, SRK <swethakasireddy@gmail.com> wrote:

> Hi,
>
> I created an external table in Spark sql using hiveContext ...something
> like
> CREATE EXTERNAL TABLE IF NOT EXISTS sampleTable stored as ORC LOCATION ...
>
> I can see the files getting created under the location I specified and able
> to query it as well... but, I don't see the table in Hive when I do show
> tables in Hive. Any idea as to why this is happening?
>
> Thanks!
>
>
>
> --
> View this message in context: http://apache-spark-user-list.
> 1001560.n3.nabble.com/Unable-to-see-external-table-that-is-
> created-from-Hive-Context-in-the-list-of-hive-tables-tp27562.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe e-mail: user-unsubscribe@spark.apache.org
>
>

Mime
View raw message