You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Ramkumar <ra...@yahoo.com> on 2012/03/15 12:23:55 UTC

Same tablename in DESTINATION and FROM clause

Hi,

Does the MR jobs of a hive query write directly to the destination or are the results of the MR jobs moved to the destination at the end?
To be more precise, is it safe to write query in the following way,

insert overwrite table X
select do_something from X join Y  on (some key)

Was little reluctant to go by the experimental results and wanted to confirm.   

Thanks,
Ram

Re: Same tablename in DESTINATION and FROM clause

Posted by Mohit Gupta <su...@gmail.com>.
RIght. It depends on where your table is stored. I didn't notice it was not
mentioned in the question that where the table is stored. I have been using
hive for s3-backed tables and the answer is no is this case.


On Sat, Mar 17, 2012 at 2:38 AM, Steven Wong <sw...@netflix.com> wrote:

>  What I’ve observed is: “yes” if the table is HDFS-backed; “it depends”
> if otherwise.****
>
> ** **
>
> ** **
>
> *From:* Mohit Gupta [mailto:success.mohit.gupta@gmail.com]
> *Sent:* Thursday, March 15, 2012 9:23 PM
> *To:* user@hive.apache.org; Ramkumar
>
> *Subject:* Re: Same tablename in DESTINATION and FROM clause****
>
> ** **
>
> No. First write the result in a temp table, then load it into the original
> table.****
>
> On Thu, Mar 15, 2012 at 4:53 PM, Ramkumar <ra...@yahoo.com>
> wrote:****
>
> Hi,****
>
> ** **
>
> Does the MR jobs of a hive query write directly to the destination or are
> the results of the MR jobs moved to the destination at the end?****
>
> To be more precise, is it safe to write query in the following way,****
>
> ** **
>
> *insert overwrite table X*
>
> *select do_something from X join Y  on (some key)*****
>
>
> Was little reluctant to go by the experimental results and wanted to
> confirm.
>
> Thanks,
> Ram****
>
> * *
>
> * *
>
> * *
>
> * *
>
> ** **
>
>
>
> ****
>
> ** **
>
> --
> Best Regards,
>
> Mohit Gupta
>
> ****
>



-- 
Best Regards,

Mohit Gupta
Software Engineer at Vdopia Inc.

RE: Same tablename in DESTINATION and FROM clause

Posted by Steven Wong <sw...@netflix.com>.
What I've observed is: "yes" if the table is HDFS-backed; "it depends" if otherwise.


From: Mohit Gupta [mailto:success.mohit.gupta@gmail.com]
Sent: Thursday, March 15, 2012 9:23 PM
To: user@hive.apache.org; Ramkumar
Subject: Re: Same tablename in DESTINATION and FROM clause

No. First write the result in a temp table, then load it into the original table.
On Thu, Mar 15, 2012 at 4:53 PM, Ramkumar <ra...@yahoo.com>> wrote:
Hi,

Does the MR jobs of a hive query write directly to the destination or are the results of the MR jobs moved to the destination at the end?
To be more precise, is it safe to write query in the following way,

insert overwrite table X
select do_something from X join Y  on (some key)

Was little reluctant to go by the experimental results and wanted to confirm.

Thanks,
Ram








--
Best Regards,

Mohit Gupta


Re: Same tablename in DESTINATION and FROM clause

Posted by Ramkumar <ra...@yahoo.com>.
Thanks mohit.



________________________________
 From: Mohit Gupta <su...@gmail.com>
To: user@hive.apache.org; Ramkumar <ra...@yahoo.com> 
Sent: Friday, March 16, 2012 4:22 AM
Subject: Re: Same tablename in DESTINATION and FROM clause
 

No. First write the result in a temp table, then load it into the original table.


On Thu, Mar 15, 2012 at 4:53 PM, Ramkumar <ra...@yahoo.com> wrote:

Hi,
>
>
>Does the MR jobs of a hive query write directly to the destination or are the results of the MR jobs moved to the destination at the end?
>To be more precise, is it safe to write query in the following way,
>
>
>insert overwrite table X
>select do_something from X join Y  on (some key)
>
>Was little reluctant to go by the experimental results and wanted to confirm.   
>
>Thanks,
>Ram
>
>
>
>
>
>
>
>
>
>
>


-- 
Best Regards,

Mohit Gupta

Re: Same tablename in DESTINATION and FROM clause

Posted by Mohit Gupta <su...@gmail.com>.
No. First write the result in a temp table, then load it into the original
table.

On Thu, Mar 15, 2012 at 4:53 PM, Ramkumar <ra...@yahoo.com>wrote:

> Hi,
>
> Does the MR jobs of a hive query write directly to the destination or are
> the results of the MR jobs moved to the destination at the end?
> To be more precise, is it safe to write query in the following way,
>
> insert overwrite table X
> select do_something from X join Y  on (some key)
>
> Was little reluctant to go by the experimental results and wanted to
> confirm.
>
> Thanks,
> Ram
>
>
>
>
>
>


-- 
Best Regards,

Mohit Gupta