You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by ram kumar <ra...@gmail.com> on 2016/04/05 06:52:03 UTC

Can't able to access temp table via jdbc client

HI,

I started a hive thrift server from hive home,
./bin/hiveserver2

opened jdbc client,
./bin/beeline
connected to thrift server,

0: > show tables;
+------------------------+--+
|        tab_name        |
+------------------------+--+
| check                  |
| people                 |
+------------------------+--+
4 rows selected (2.085 seconds)
0:>

I can't see the temp tables which i registered with HiveContext
from pyspark.sql import HiveContext, Row
schemaPeople.registerTempTable("testtemp")
Can some1 help me with it

Thanks

Re: Can't able to access temp table via jdbc client

Posted by ram kumar <ra...@gmail.com>.
Thanks for you input.

But, the jdbc client should be something like this,

{{{
$ *./bin/beeline*
Beeline version 1.5.2 by Apache Hive
beeline>*!connect jdbc:hive2://ip:10000*
*show tables;*
+------------+--------------+--+
| tableName  | isTemporary  |
+------------+--------------+--+
| check      | false        |
+------------+--------------+--+
5 rows selected (0.126 seconds)
>
}}}
The isTemporary column is not seen.
I suppose the thrift server should be started from spark home

On Tue, Apr 5, 2016 at 1:08 PM, Mich Talebzadeh <mi...@gmail.com>
wrote:

> Hi
>
> temp tables are session specific and private to the session. You will not
> be able to see temp tables created by another session in HiveContext.
>
> Likewise creating a table in Hive using a syntax similar to below
>
> CREATE TEMPORARY TABLE tmp AS
> SELECT t.calendar_month_desc, c.channel_desc, SUM(s.amount_sold) AS
> TotalSales
>
> will only be visible to that session and is created under /tmp/hive/hduser.
>
> 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
>
>
>
> On 5 April 2016 at 05:52, ram kumar <ra...@gmail.com> wrote:
>
>> HI,
>>
>> I started a hive thrift server from hive home,
>> ./bin/hiveserver2
>>
>> opened jdbc client,
>> ./bin/beeline
>> connected to thrift server,
>>
>> 0: > show tables;
>> +------------------------+--+
>> |        tab_name        |
>> +------------------------+--+
>> | check                  |
>> | people                 |
>> +------------------------+--+
>> 4 rows selected (2.085 seconds)
>> 0:>
>>
>> I can't see the temp tables which i registered with HiveContext
>> from pyspark.sql import HiveContext, Row
>> schemaPeople.registerTempTable("testtemp")
>> Can some1 help me with it
>>
>> Thanks
>>
>>
>

Re: Can't able to access temp table via jdbc client

Posted by Mich Talebzadeh <mi...@gmail.com>.
Hi

temp tables are session specific and private to the session. You will not
be able to see temp tables created by another session in HiveContext.

Likewise creating a table in Hive using a syntax similar to below

CREATE TEMPORARY TABLE tmp AS
SELECT t.calendar_month_desc, c.channel_desc, SUM(s.amount_sold) AS
TotalSales

will only be visible to that session and is created under /tmp/hive/hduser.

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



On 5 April 2016 at 05:52, ram kumar <ra...@gmail.com> wrote:

> HI,
>
> I started a hive thrift server from hive home,
> ./bin/hiveserver2
>
> opened jdbc client,
> ./bin/beeline
> connected to thrift server,
>
> 0: > show tables;
> +------------------------+--+
> |        tab_name        |
> +------------------------+--+
> | check                  |
> | people                 |
> +------------------------+--+
> 4 rows selected (2.085 seconds)
> 0:>
>
> I can't see the temp tables which i registered with HiveContext
> from pyspark.sql import HiveContext, Row
> schemaPeople.registerTempTable("testtemp")
> Can some1 help me with it
>
> Thanks
>
>

Re: Can't able to access temp table via jdbc client

Posted by Mich Talebzadeh <mi...@gmail.com>.
Hi

temp tables are session specific and private to the session. You will not
be able to see temp tables created by another session in HiveContext.

Likewise creating a table in Hive using a syntax similar to below

CREATE TEMPORARY TABLE tmp AS
SELECT t.calendar_month_desc, c.channel_desc, SUM(s.amount_sold) AS
TotalSales

will only be visible to that session and is created under /tmp/hive/hduser.

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



On 5 April 2016 at 05:52, ram kumar <ra...@gmail.com> wrote:

> HI,
>
> I started a hive thrift server from hive home,
> ./bin/hiveserver2
>
> opened jdbc client,
> ./bin/beeline
> connected to thrift server,
>
> 0: > show tables;
> +------------------------+--+
> |        tab_name        |
> +------------------------+--+
> | check                  |
> | people                 |
> +------------------------+--+
> 4 rows selected (2.085 seconds)
> 0:>
>
> I can't see the temp tables which i registered with HiveContext
> from pyspark.sql import HiveContext, Row
> schemaPeople.registerTempTable("testtemp")
> Can some1 help me with it
>
> Thanks
>
>