You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Sanjay Sharma <sa...@impetus.co.in> on 2010/03/05 15:06:18 UTC

CTAS- Hive 0.5.0

Hi,
Am trying to get Create Table ... AS SELECT working in Hive 0.50.0 but still getting {mismatched input 'AS' expecting EOF} error.

Jira HIVE-31 patch seems to be present in Hive 0.5.0 so might be something to do with the syntax .

Any suggestions on what is the correct syntax or whether it is supposed to work in 0.5.


Regards,
Sanjay

Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and wireless domain expertise. Click http://impetus.com/events to know more.

Follow our updates on www.twitter.com/impetuscalling.

NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

Re: CTAS- Hive 0.5.0

Posted by Sonal Goyal <so...@gmail.com>.
Sanjay,

I use the following:

create table products_bought (....);
insert overwrite table products_bought select ... from tableMaster;


Thanks and Regards,
Sonal


On Fri, Mar 5, 2010 at 7:36 PM, Sanjay Sharma
<sa...@impetus.co.in>wrote:

> Hi,
> Am trying to get Create Table ... AS SELECT working in Hive 0.50.0 but
> still getting {mismatched input 'AS' expecting EOF} error.
>
> Jira HIVE-31 patch seems to be present in Hive 0.5.0 so might be something
> to do with the syntax .
>
> Any suggestions on what is the correct syntax or whether it is supposed to
> work in 0.5.
>
>
> Regards,
> Sanjay
>
> Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd
> to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and
> wireless domain expertise. Click http://impetus.com/events to know more.
>
> Follow our updates on www.twitter.com/impetuscalling.
>
> NOTE: This message may contain information that is confidential,
> proprietary, privileged or otherwise protected by law. The message is
> intended solely for the named addressee. If received in error, please
> destroy and notify the sender. Any use of this email is prohibited when
> received in error. Impetus does not represent, warrant and/or guarantee,
> that the integrity of this communication has been maintained nor that the
> communication is free of errors, virus, interception or interference.
>

RE: CTAS- Hive 0.5.0

Posted by Sanjay Sharma <sa...@impetus.co.in>.
Thanks Ning.
Works now- had to restart Hadoop cluster to get it running though-could not understand why?

Regards,
Sanjay Sharma
Impetus
t: +91-120-4363300 Extn 2761

-----Original Message-----
From: Ning Zhang [mailto:nzhang@facebook.com]
Sent: Friday, March 05, 2010 10:08 PM
To: hive-user@hadoop.apache.org
Subject: Re: CTAS- Hive 0.5.0

Can you post your query? It should work like

create table T as select a, b+1 b1, c*2 c2 from S where ...


You don't need to specify the schema of T cause it is derived from the select-clause. T's column's name is the same as the alias name in the select-clause.

Thanks,
Ning

On Mar 5, 2010, at 6:06 AM, Sanjay Sharma wrote:

> Hi,
> Am trying to get Create Table ... AS SELECT working in Hive 0.50.0 but still getting {mismatched input 'AS' expecting EOF} error.
>
> Jira HIVE-31 patch seems to be present in Hive 0.5.0 so might be something to do with the syntax .
>
> Any suggestions on what is the correct syntax or whether it is supposed to work in 0.5.
>
>
> Regards,
> Sanjay
>
> Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and wireless domain expertise. Click http://impetus.com/events to know more.
>
> Follow our updates on www.twitter.com/impetuscalling.
>
> NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.


Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and wireless domain expertise. Click http://impetus.com/events to know more.

Follow our updates on www.twitter.com/impetuscalling.

NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

Re: CTAS- Hive 0.5.0

Posted by Ning Zhang <nz...@facebook.com>.
Can you post your query? It should work like 

create table T as select a, b+1 b1, c*2 c2 from S where ...


You don't need to specify the schema of T cause it is derived from the select-clause. T's column's name is the same as the alias name in the select-clause. 

Thanks,
Ning

On Mar 5, 2010, at 6:06 AM, Sanjay Sharma wrote:

> Hi,
> Am trying to get Create Table ... AS SELECT working in Hive 0.50.0 but still getting {mismatched input 'AS' expecting EOF} error.
> 
> Jira HIVE-31 patch seems to be present in Hive 0.5.0 so might be something to do with the syntax .
> 
> Any suggestions on what is the correct syntax or whether it is supposed to work in 0.5.
> 
> 
> Regards,
> Sanjay
> 
> Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and wireless domain expertise. Click http://impetus.com/events to know more.
> 
> Follow our updates on www.twitter.com/impetuscalling.
> 
> NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.