You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Prashant <pr...@gmail.com> on 2015/01/06 21:53:55 UTC

Temp table Vs Sub Query in Hive

Hi All:

In our process, we have created a temporary table which is built from UNION
ALL of 3 different queries. The temp table is used in further query in
join.

We want to get rid of the temp table and have it integrated in final query.
Is there any better  way to implement in Hive rather than placing the query
that created temp table as a subquery in the from clause? The temp table
would eventually get lots of rows so performance will be a key.


Thanks!

~ Prashant

Re: Temp table Vs Sub Query in Hive

Posted by Bala Krishna Gangisetty <ba...@altiscale.com>.
Prashant,

You might also want to explore Views in Hive.

--Bala G.

On Tue, Jan 6, 2015 at 1:12 PM, Hulbert, Leland <Le...@epsilon.com>
wrote:

>  Prashant,
>
>                 What version of Hive are you running?  Common Table
> Expressions were added in 0.13.  Take a look here:
> https://cwiki.apache.org/confluence/display/Hive/Common+Table+Expression
>
>
>
>
>
> Lee
>
>
>
> *From:* Prashant [mailto:prashant.gijare@gmail.com]
> *Sent:* Tuesday, January 06, 2015 3:54 PM
> *To:* user@hive.apache.org
> *Subject:* Temp table Vs Sub Query in Hive
>
>
>
> Hi All:
>
>
>
> In our process, we have created a temporary table which is built from
> UNION ALL of 3 different queries. The temp table is used in further query
> in join.
>
>
>
> We want to get rid of the temp table and have it integrated in final
> query. Is there any better  way to implement in Hive rather than placing
> the query that created temp table as a subquery in the from clause? The
> temp table would eventually get lots of rows so performance will be a key.
>
>
>
>
>
> Thanks!
>
>
>
> ~ Prashant
>
>
>
>
>
> ------------------------------
>
> This e-mail and files transmitted with it are confidential, and are
> intended solely for the use of the individual or entity to whom this e-mail
> is addressed. If you are not the intended recipient, or the employee or
> agent responsible to deliver it to the intended recipient, you are hereby
> notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you are not one of the named
> recipient(s) or otherwise have reason to believe that you received this
> message in error, please immediately notify sender by e-mail, and destroy
> the original message. Thank You.
>

RE: Temp table Vs Sub Query in Hive

Posted by "Hulbert, Leland" <Le...@epsilon.com>.
Prashant,
                What version of Hive are you running?  Common Table Expressions were added in 0.13.  Take a look here: https://cwiki.apache.org/confluence/display/Hive/Common+Table+Expression


Lee

From: Prashant [mailto:prashant.gijare@gmail.com]
Sent: Tuesday, January 06, 2015 3:54 PM
To: user@hive.apache.org
Subject: Temp table Vs Sub Query in Hive

Hi All:

In our process, we have created a temporary table which is built from UNION ALL of 3 different queries. The temp table is used in further query in join.

We want to get rid of the temp table and have it integrated in final query. Is there any better  way to implement in Hive rather than placing the query that created temp table as a subquery in the from clause? The temp table would eventually get lots of rows so performance will be a key.


Thanks!

~ Prashant



________________________________

This e-mail and files transmitted with it are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you are not one of the named recipient(s) or otherwise have reason to believe that you received this message in error, please immediately notify sender by e-mail, and destroy the original message. Thank You.