|
|
-
insert into not supported?
chen keven 2009-07-21, 21:34
I tried to use" insert into " command to insert data in table. However, hive doesn't recognize it. It gives me error like mismatched input 'into' expecting overwrite in insert clause. "insert overwrite" simply overwrite the data in the table. But I need to concatenate the data. I did a quick search, I found some previous presentation talking about insert into. Did I do something wrong?
-- Thank you, Keven Chen
-
RE: insert into not supported?
Namit Jain 2009-07-21, 21:38
Currently, hive only supports overwriting the data - appending is not supported From: chen keven [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 21, 2009 2:34 PM To: [EMAIL PROTECTED] Subject: insert into not supported?
I tried to use" insert into " command to insert data in table. However, hive doesn't recognize it. It gives me error like mismatched input 'into' expecting overwrite in insert clause. "insert overwrite" simply overwrite the data in the table. But I need to concatenate the data. I did a quick search, I found some previous presentation talking about insert into. Did I do something wrong?
-- Thank you, Keven Chen
-
Re: insert into not supported?
Zheng Shao 2009-07-21, 21:40
Hi Chen,
We don't directly support "Insert into" for now.
In our cluster, we set up tables to be "partitioned" and load/insert overwrite one partition at a time. This will probably work for you as well (assuming you are doing data warehouse) If this does not, there is still a work-around: INSERT OVERWRITE INTO TABLE myTable SELECT ... FROM ... UNION ALL SELECT * from myTable;
As you can imagine, this approach is not very efficiently. So we recommend the "partitioned" approach if it fits to your requirements.
Zheng On Tue, Jul 21, 2009 at 2:38 PM, Namit Jain<[EMAIL PROTECTED]> wrote: > Currently, hive only supports overwriting the data – appending is not > supported > > > > > > From: chen keven [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 21, 2009 2:34 PM > To: [EMAIL PROTECTED] > Subject: insert into not supported? > > > > I tried to use" insert into " command to insert data in table. However, > hive doesn't recognize it. It gives me error like mismatched input 'into' > expecting overwrite in insert clause. > "insert overwrite" simply overwrite the data in the table. But I need to > concatenate the data. I did a quick search, I found some previous > presentation talking about insert into. Did I do something wrong? > > -- > Thank you, > Keven Chen
-- Yours, Zheng
-
RE: insert into not supported?
Ashish Thusoo 2009-07-21, 21:41
a work around right now is
insert overwrite t select * from (select * from t union all select * from t_new) Ashish
________________________________ From: Namit Jain [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 21, 2009 2:38 PM To: [EMAIL PROTECTED] Subject: RE: insert into not supported?
Currently, hive only supports overwriting the data - appending is not supported From: chen keven [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 21, 2009 2:34 PM To: [EMAIL PROTECTED] Subject: insert into not supported?
I tried to use" insert into " command to insert data in table. However, hive doesn't recognize it. It gives me error like mismatched input 'into' expecting overwrite in insert clause. "insert overwrite" simply overwrite the data in the table. But I need to concatenate the data. I did a quick search, I found some previous presentation talking about insert into. Did I do something wrong?
-- Thank you, Keven Chen
-
Re: insert into not supported?
Saurabh Nanda 2009-07-22, 05:38
> Currently, hive only supports overwriting the data – appending is not > supported > Never ran into this problem till now, but will soon begin to once I start loading more days of weblog data into the cluster. Can I append data into a table if each INSERT INTO is in a new partition? Saurabh. -- http://nandz.blogspot.comhttp://foodieforlife.blogspot.com
-
Re: insert into not supported?
Zheng Shao 2009-07-22, 05:41
Yes that's exactly what we do here. See my reply in an earlier email. Zheng On Tue, Jul 21, 2009 at 10:38 PM, Saurabh Nanda<[EMAIL PROTECTED]> wrote: > >> Currently, hive only supports overwriting the data – appending is not >> supported > > Never ran into this problem till now, but will soon begin to once I start > loading more days of weblog data into the cluster. Can I append data into a > table if each INSERT INTO is in a new partition? > > Saurabh. > -- > http://nandz.blogspot.com> http://foodieforlife.blogspot.com> -- Yours, Zheng
-
Re: insert into not supported?
Keven Chen 2009-07-22, 05:55
Thank you very much. It really helps. On Tue, Jul 21, 2009 at 10:41 PM, Zheng Shao <[EMAIL PROTECTED]> wrote: > Yes that's exactly what we do here. > See my reply in an earlier email. > > Zheng > > On Tue, Jul 21, 2009 at 10:38 PM, Saurabh Nanda<[EMAIL PROTECTED]> > wrote: > > > >> Currently, hive only supports overwriting the data – appending is not > >> supported > > > > Never ran into this problem till now, but will soon begin to once I start > > loading more days of weblog data into the cluster. Can I append data into > a > > table if each INSERT INTO is in a new partition? > > > > Saurabh. > > -- > > http://nandz.blogspot.com> > http://foodieforlife.blogspot.com> > > > > > -- > Yours, > Zheng > -- Thank you, Keven Chen
|
|