You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by chen keven <ck...@gmail.com> on 2009/07/21 23:34:04 UTC

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?

Posted by Zheng Shao <zs...@gmail.com>.
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<nj...@facebook.com> wrote:
> Currently, hive only supports overwriting the data – appending is not
> supported
>
>
>
>
>
> From: chen keven [mailto:ckeven@gmail.com]
> Sent: Tuesday, July 21, 2009 2:34 PM
> To: hive-user@hadoop.apache.org
> 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?

Posted by Ashish Thusoo <at...@facebook.com>.
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:njain@facebook.com]
Sent: Tuesday, July 21, 2009 2:38 PM
To: hive-user@hadoop.apache.org
Subject: RE: insert into not supported?

Currently, hive only supports overwriting the data - appending is not supported


From: chen keven [mailto:ckeven@gmail.com]
Sent: Tuesday, July 21, 2009 2:34 PM
To: hive-user@hadoop.apache.org
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?

Posted by Keven Chen <ck...@gmail.com>.
Thank you very much. It really helps.

On Tue, Jul 21, 2009 at 10:41 PM, Zheng Shao <zs...@gmail.com> 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<sa...@gmail.com>
> 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

Re: insert into not supported?

Posted by Zheng Shao <zs...@gmail.com>.
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<sa...@gmail.com> 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?

Posted by Saurabh Nanda <sa...@gmail.com>.
>  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

RE: insert into not supported?

Posted by Namit Jain <nj...@facebook.com>.
Currently, hive only supports overwriting the data - appending is not supported


From: chen keven [mailto:ckeven@gmail.com]
Sent: Tuesday, July 21, 2009 2:34 PM
To: hive-user@hadoop.apache.org
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