You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "E. Sammer" <er...@lifeless.net> on 2010/02/13 01:41:03 UTC

Create table as select

The Hive wiki states the following for the CREATE TABLE ... DDL:

"AS select_statement]  (Note: this feature is only available on the 
latest trunk or versions higher than 0.4.0.)"

I'm testing this syntax on 0.4.0(+14 - Cloudera distro) and I'm getting 
errors from the query parser at the second occurrence of 'as' for the 
select portion.

hive> describe raw_facts;
OK
year    int
month   int
day     int
... other fields...
Time taken: 0.339 seconds

hive> create table foo row format delimited fields terminated by '\t' 
stored as textfile as select year, month from raw_facts limit 20 ;
FAILED: Parse Error: line 1:83 mismatched input 'as' expecting EOF

I've tried other variations such as without the stored as clause and all 
uppercase but receive the same error. Is this incorrect usage on my part 
or is the CTAS syntax versions higher than 0.4.0, exclusive?

Thanks in advance.
-- 
Eric Sammer
eric@lifeless.net
http://esammer.blogspot.com

Re: Create table as select

Posted by "E. Sammer" <er...@lifeless.net>.
On 2/12/10 7:57 PM, Ning Zhang wrote:
> I guess what Namit meant is CTAS is NOT supported in release 0.4, but only in 0.5 or trunk.

Got it. That's what I thought. Thanks!

-- 
Eric Sammer
eric@lifeless.net
http://esammer.blogspot.com

Re: Create table as select

Posted by Ning Zhang <nz...@facebook.com>.
I guess what Namit meant is CTAS is NOT supported in release 0.4, but only in 0.5 or trunk.

Ning

On Feb 12, 2010, at 4:43 PM, Namit Jain wrote:

> Create table as select in supported in Hive 0.4 release. It is a new feature in 0.5
> 
> -----Original Message-----
> From: E. Sammer [mailto:eric@lifeless.net] 
> Sent: Friday, February 12, 2010 4:41 PM
> To: hive-user@hadoop.apache.org
> Subject: Create table as select
> 
> The Hive wiki states the following for the CREATE TABLE ... DDL:
> 
> "AS select_statement]  (Note: this feature is only available on the 
> latest trunk or versions higher than 0.4.0.)"
> 
> I'm testing this syntax on 0.4.0(+14 - Cloudera distro) and I'm getting 
> errors from the query parser at the second occurrence of 'as' for the 
> select portion.
> 
> hive> describe raw_facts;
> OK
> year    int
> month   int
> day     int
> ... other fields...
> Time taken: 0.339 seconds
> 
> hive> create table foo row format delimited fields terminated by '\t' 
> stored as textfile as select year, month from raw_facts limit 20 ;
> FAILED: Parse Error: line 1:83 mismatched input 'as' expecting EOF
> 
> I've tried other variations such as without the stored as clause and all 
> uppercase but receive the same error. Is this incorrect usage on my part 
> or is the CTAS syntax versions higher than 0.4.0, exclusive?
> 
> Thanks in advance.
> -- 
> Eric Sammer
> eric@lifeless.net
> http://esammer.blogspot.com


Re: Create table as select

Posted by "E. Sammer" <er...@lifeless.net>.
On 2/12/10 7:43 PM, Namit Jain wrote:
> Create table as select in supported in Hive 0.4 release. It is a new feature in 0.5

These two sentences seem contradictory. Did you mean "create table as 
select is NOT supported in Hive 0.4 release," maybe?

>
> -----Original Message-----
> From: E. Sammer [mailto:eric@lifeless.net]
> Sent: Friday, February 12, 2010 4:41 PM
> To: hive-user@hadoop.apache.org
> Subject: Create table as select
>
> The Hive wiki states the following for the CREATE TABLE ... DDL:
>
> "AS select_statement]  (Note: this feature is only available on the
> latest trunk or versions higher than 0.4.0.)"
>
> I'm testing this syntax on 0.4.0(+14 - Cloudera distro) and I'm getting
> errors from the query parser at the second occurrence of 'as' for the
> select portion.
>
> hive>  describe raw_facts;
> OK
> year    int
> month   int
> day     int
> ... other fields...
> Time taken: 0.339 seconds
>
> hive>  create table foo row format delimited fields terminated by '\t'
> stored as textfile as select year, month from raw_facts limit 20 ;
> FAILED: Parse Error: line 1:83 mismatched input 'as' expecting EOF
>
> I've tried other variations such as without the stored as clause and all
> uppercase but receive the same error. Is this incorrect usage on my part
> or is the CTAS syntax versions higher than 0.4.0, exclusive?
>
> Thanks in advance.


-- 
Eric Sammer
eric@lifeless.net
http://esammer.blogspot.com

RE: Create table as select

Posted by Namit Jain <nj...@facebook.com>.
Create table as select in supported in Hive 0.4 release. It is a new feature in 0.5

-----Original Message-----
From: E. Sammer [mailto:eric@lifeless.net] 
Sent: Friday, February 12, 2010 4:41 PM
To: hive-user@hadoop.apache.org
Subject: Create table as select

The Hive wiki states the following for the CREATE TABLE ... DDL:

"AS select_statement]  (Note: this feature is only available on the 
latest trunk or versions higher than 0.4.0.)"

I'm testing this syntax on 0.4.0(+14 - Cloudera distro) and I'm getting 
errors from the query parser at the second occurrence of 'as' for the 
select portion.

hive> describe raw_facts;
OK
year    int
month   int
day     int
... other fields...
Time taken: 0.339 seconds

hive> create table foo row format delimited fields terminated by '\t' 
stored as textfile as select year, month from raw_facts limit 20 ;
FAILED: Parse Error: line 1:83 mismatched input 'as' expecting EOF

I've tried other variations such as without the stored as clause and all 
uppercase but receive the same error. Is this incorrect usage on my part 
or is the CTAS syntax versions higher than 0.4.0, exclusive?

Thanks in advance.
-- 
Eric Sammer
eric@lifeless.net
http://esammer.blogspot.com