You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Bhavesh Shah <bh...@gmail.com> on 2012/01/18 06:00:43 UTC

Related to INSERT QUERY in Hive

Hello,
I am using Hive-0.7.1. I want to append the data in table.
Is hive-0.7.1 support appending feature or just support OVERWRITE feature?
When I tried for the appending, the query is not working.

What should I do in such case so that I append the data in table?

-- 
Thanks and Regards,
Bhavesh Shah

Re: Related to INSERT QUERY in Hive

Posted by Able C <ca...@gmail.com>.
Hello  Bhavesh Shah:

 Appending feature  (insert into ) not supported in hive-0.7.*

three  ways :
1:hadoop fs -put localfile hdfs:/.../.../table_dir/partiton_dir/
2:use hive-0.8
3: patch your hive with https://issues.apache.org/jira/browse/HIVE-306


2012/1/18 Bhavesh Shah <bh...@gmail.com>

> Hello,
> I am using Hive-0.7.1. I want to append the data in table.
> Is hive-0.7.1 support appending feature or just support OVERWRITE feature?
> When I tried for the appending, the query is not working.
>
> What should I do in such case so that I append the data in table?
>
> --
> Thanks and Regards,
> Bhavesh Shah
>
>


-- 
Best wishs!
曹 坤

Re: Related to INSERT QUERY in Hive

Posted by Ankit Jain <an...@gmail.com>.
 Load data inpath will append data into Hive table .. this feature is also
supported in Hive-0.7.*.

Ex: load data local inpath './examples/files/kv1.txt' into table test1;

This commad will append data into test1 table.

On Wed, Jan 18, 2012 at 10:55 AM, Aniket Mokashi <an...@gmail.com>wrote:

> how about Load data inpath?
>
>
> On Tue, Jan 17, 2012 at 9:00 PM, Bhavesh Shah <bh...@gmail.com>wrote:
>
>> Hello,
>> I am using Hive-0.7.1. I want to append the data in table.
>> Is hive-0.7.1 support appending feature or just support OVERWRITE feature?
>> When I tried for the appending, the query is not working.
>>
>> What should I do in such case so that I append the data in table?
>>
>> --
>> Thanks and Regards,
>> Bhavesh Shah
>>
>>
>
>
> --
> "...:::Aniket:::... Quetzalco@tl"
>

Re: Related to INSERT QUERY in Hive

Posted by alo alt <wg...@googlemail.com>.
Please note:

LOAD DATA LOCAL assumes the data in the given local path (maybe /tmp/data) and copy the data into hive's warehouse-dir
LOAD DATA /path moves the date from an given path in HDFS into hive's warehouse-dir

When you want to append data into an table you have to use partitioning.

best,
 Alex 

--
Alexander Lorenz
http://mapredit.blogspot.com

On Jan 18, 2012, at 7:37 AM, Krishnan Krishnamoorthy wrote:

> Hi Aniket/Bhavesh,
>  
> Actually load data inpath is used for appending file and the path refers to the HDFS path.
> We can use load data local inpath  in case the input file to be loaded is not in HDFS but it is present in the local system.
>  
> Both of these append the data. In case, you need to overwrite the data, use
> load data inpath ‘/foo/write/bar.txt’ OVERWRITE into table tblname;
> OR
> load data local inpath ‘/foo/write/bar.txt’ OVERWRITE into table tblname; (in case the input file to be loaded is not in HDFS but it is present in the local system)
>  
> Regards,
> Krishnan
>  
> From: Aniket Mokashi [mailto:aniket486@gmail.com] 
> Sent: Wednesday, January 18, 2012 10:56 AM
> To: user@hive.apache.org
> Subject: Re: Related to INSERT QUERY in Hive
>  
> how about Load data inpath? 
> 
> On Tue, Jan 17, 2012 at 9:00 PM, Bhavesh Shah <bh...@gmail.com> wrote:
> Hello,
> I am using Hive-0.7.1. I want to append the data in table.
> Is hive-0.7.1 support appending feature or just support OVERWRITE feature?
> When I tried for the appending, the query is not working.
> 
> What should I do in such case so that I append the data in table?
> 
> -- 
> Thanks and Regards,
> Bhavesh Shah
>  
> 
> 
>  
> -- 
> "...:::Aniket:::... Quetzalco@tl"
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
> for the use of the addressee(s). If you are not the intended recipient, please
> notify the sender by e-mail and delete the original message. Further, you are not
> to copy, disclose, or distribute this e-mail or its contents to any other person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
> every reasonable precaution to minimize this risk, but is not liable for any damage
> you may sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves the
> right to monitor and review the content of all messages sent to or from this e-mail
> address. Messages sent to or from this e-mail address may be stored on the
> Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> 


RE: Related to INSERT QUERY in Hive

Posted by Krishnan Krishnamoorthy <Kr...@infosys.com>.
Hi Aniket/Bhavesh,

Actually load data inpath is used for appending file and the path refers to the HDFS path.
We can use load data local inpath  in case the input file to be loaded is not in HDFS but it is present in the local system.

Both of these append the data. In case, you need to overwrite the data, use
load data inpath '/foo/write/bar.txt' OVERWRITE into table tblname;
OR
load data local inpath '/foo/write/bar.txt' OVERWRITE into table tblname; (in case the input file to be loaded is not in HDFS but it is present in the local system)

Regards,
Krishnan

From: Aniket Mokashi [mailto:aniket486@gmail.com]
Sent: Wednesday, January 18, 2012 10:56 AM
To: user@hive.apache.org
Subject: Re: Related to INSERT QUERY in Hive

how about Load data inpath?
On Tue, Jan 17, 2012 at 9:00 PM, Bhavesh Shah <bh...@gmail.com>> wrote:
Hello,
I am using Hive-0.7.1. I want to append the data in table.
Is hive-0.7.1 support appending feature or just support OVERWRITE feature?
When I tried for the appending, the query is not working.

What should I do in such case so that I append the data in table?

--
Thanks and Regards,
Bhavesh Shah




--
"...:::Aniket:::... Quetzalco@tl"

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Re: Related to INSERT QUERY in Hive

Posted by Aniket Mokashi <an...@gmail.com>.
how about Load data inpath?

On Tue, Jan 17, 2012 at 9:00 PM, Bhavesh Shah <bh...@gmail.com>wrote:

> Hello,
> I am using Hive-0.7.1. I want to append the data in table.
> Is hive-0.7.1 support appending feature or just support OVERWRITE feature?
> When I tried for the appending, the query is not working.
>
> What should I do in such case so that I append the data in table?
>
> --
> Thanks and Regards,
> Bhavesh Shah
>
>


-- 
"...:::Aniket:::... Quetzalco@tl"