You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Manish Kothari <Ma...@vonage.com> on 2014/07/09 18:20:10 UTC

Error while renaming Partitioned column name

Hi,

I have a table name siplogs_partitioned which is partitioned by columns str_date(DATE) and str_hour(INT). I want to rename the partitioned columns to call_date and call_hour.

I am using the below command to alter the partitioned column name: -

ALTER TABLE siplogs_partitioned PARTITION str_date RENAME TO PARTITION call_date;

When I run the above command I am getting an error : -

FAILED: ParseException line 1:12 cannot recognize input near 'siplogs_partitioned' 'PARTITION' 'str_date' in alter table partition statement

Is the "ALTER TABLE" usage correct to rename the partitioned column names?

Any pointer or help is appreciated.

Thanks,
Manish

Re: Error while renaming Partitioned column name

Posted by D K <de...@gmail.com>.
I mistook as renaming the partition value. Hive lets you change the value
of a partition column, in your case it would have been:
ALTER TABLE siplogs_partitioned PARTITION (str_date='old date
value',str_hour='old hour value') RENAME TO PARTITION (str_date='new date
value',str_hour='new hour value');

I think you cannot change the partition name in Hive.

-Deepesh


On Wed, Jul 9, 2014 at 10:48 AM, Nitin Pawar <ni...@gmail.com>
wrote:

> whats your table DDL?
>
>
> On Wed, Jul 9, 2014 at 11:03 PM, Manish Kothari <Manish.Kothari@vonage.com
> > wrote:
>
>>  Thanks Dipesh.
>>
>>
>>
>> Here is what I tried : -
>>
>>
>>
>> ALTER TABLE siplogs_partitioned PARTITION
>> (pcol1='str_hour',pcol2='str_date') RENAME TO PARTITION
>> (pcol1='call_hour',pcol2='call_date');
>>
>>
>>
>> When I run the above command I am getting the error below : -
>>
>>
>>
>> FAILED: Execution Error, return code 1 from
>> org.apache.hadoop.hive.ql.exec.DDLTask. str_date not found in table's
>> partition spec: {pcol1=str_hour, pcol2=str_date}
>>
>>
>>
>> Am I missing something here?
>>
>>
>>
>> Thanks,
>>
>> Manish
>>
>>
>>
>>
>>
>> *From:* D K [mailto:deepeshk@gmail.com]
>> *Sent:* Wednesday, July 09, 2014 12:38 PM
>> *To:* user@hive.apache.org
>> *Subject:* Re: Error while renaming Partitioned column name
>>
>>
>>
>> Here is an example:
>> ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1',
>> pcol2='old_part2') RENAME TO PARTITION (pCol1='new_part1',
>> pcol2='new_part2');
>>
>>
>>
>> On Wed, Jul 9, 2014 at 9:20 AM, Manish Kothari <Ma...@vonage.com>
>> wrote:
>>
>> Hi,
>>
>>
>>
>> I have a table name siplogs_partitioned which is partitioned by columns
>> str_date(DATE) and str_hour(INT). I want to rename the partitioned columns
>> to call_date and call_hour.
>>
>>
>>
>> I am using the below command to alter the partitioned column name: -
>>
>>
>>
>> ALTER TABLE siplogs_partitioned PARTITION str_date RENAME TO PARTITION
>> call_date;
>>
>>
>>
>> When I run the above command I am getting an error : -
>>
>>
>>
>> FAILED: ParseException line 1:12 cannot recognize input near
>> 'siplogs_partitioned' 'PARTITION' 'str_date' in alter table partition
>> statement
>>
>>
>>
>> Is the “ALTER TABLE” usage correct to rename the partitioned column names?
>>
>>
>>
>> Any pointer or help is appreciated.
>>
>>
>>
>> Thanks,
>>
>> Manish
>>
>>
>>
>
>
>
> --
> Nitin Pawar
>

Re: Error while renaming Partitioned column name

Posted by Nitin Pawar <ni...@gmail.com>.
whats your table DDL?


On Wed, Jul 9, 2014 at 11:03 PM, Manish Kothari <Ma...@vonage.com>
wrote:

>  Thanks Dipesh.
>
>
>
> Here is what I tried : -
>
>
>
> ALTER TABLE siplogs_partitioned PARTITION
> (pcol1='str_hour',pcol2='str_date') RENAME TO PARTITION
> (pcol1='call_hour',pcol2='call_date');
>
>
>
> When I run the above command I am getting the error below : -
>
>
>
> FAILED: Execution Error, return code 1 from
> org.apache.hadoop.hive.ql.exec.DDLTask. str_date not found in table's
> partition spec: {pcol1=str_hour, pcol2=str_date}
>
>
>
> Am I missing something here?
>
>
>
> Thanks,
>
> Manish
>
>
>
>
>
> *From:* D K [mailto:deepeshk@gmail.com]
> *Sent:* Wednesday, July 09, 2014 12:38 PM
> *To:* user@hive.apache.org
> *Subject:* Re: Error while renaming Partitioned column name
>
>
>
> Here is an example:
> ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1',
> pcol2='old_part2') RENAME TO PARTITION (pCol1='new_part1',
> pcol2='new_part2');
>
>
>
> On Wed, Jul 9, 2014 at 9:20 AM, Manish Kothari <Ma...@vonage.com>
> wrote:
>
> Hi,
>
>
>
> I have a table name siplogs_partitioned which is partitioned by columns
> str_date(DATE) and str_hour(INT). I want to rename the partitioned columns
> to call_date and call_hour.
>
>
>
> I am using the below command to alter the partitioned column name: -
>
>
>
> ALTER TABLE siplogs_partitioned PARTITION str_date RENAME TO PARTITION
> call_date;
>
>
>
> When I run the above command I am getting an error : -
>
>
>
> FAILED: ParseException line 1:12 cannot recognize input near
> 'siplogs_partitioned' 'PARTITION' 'str_date' in alter table partition
> statement
>
>
>
> Is the “ALTER TABLE” usage correct to rename the partitioned column names?
>
>
>
> Any pointer or help is appreciated.
>
>
>
> Thanks,
>
> Manish
>
>
>



-- 
Nitin Pawar

RE: Error while renaming Partitioned column name

Posted by Manish Kothari <Ma...@vonage.com>.
Thanks Dipesh.

Here is what I tried : -

ALTER TABLE siplogs_partitioned PARTITION (pcol1='str_hour',pcol2='str_date') RENAME TO PARTITION (pcol1='call_hour',pcol2='call_date');

When I run the above command I am getting the error below : -

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. str_date not found in table's partition spec: {pcol1=str_hour, pcol2=str_date}

Am I missing something here?

Thanks,
Manish


From: D K [mailto:deepeshk@gmail.com]
Sent: Wednesday, July 09, 2014 12:38 PM
To: user@hive.apache.org
Subject: Re: Error while renaming Partitioned column name

Here is an example:
ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1', pcol2='old_part2') RENAME TO PARTITION (pCol1='new_part1', pcol2='new_part2');

On Wed, Jul 9, 2014 at 9:20 AM, Manish Kothari <Ma...@vonage.com>> wrote:
Hi,

I have a table name siplogs_partitioned which is partitioned by columns str_date(DATE) and str_hour(INT). I want to rename the partitioned columns to call_date and call_hour.

I am using the below command to alter the partitioned column name: -

ALTER TABLE siplogs_partitioned PARTITION str_date RENAME TO PARTITION call_date;

When I run the above command I am getting an error : -

FAILED: ParseException line 1:12 cannot recognize input near 'siplogs_partitioned' 'PARTITION' 'str_date' in alter table partition statement

Is the “ALTER TABLE” usage correct to rename the partitioned column names?

Any pointer or help is appreciated.

Thanks,
Manish


Re: Error while renaming Partitioned column name

Posted by D K <de...@gmail.com>.
Here is an example:
ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1',
pcol2='old_part2') RENAME TO PARTITION (pCol1='new_part1',
pcol2='new_part2');



On Wed, Jul 9, 2014 at 9:20 AM, Manish Kothari <Ma...@vonage.com>
wrote:

>  Hi,
>
>
>
> I have a table name siplogs_partitioned which is partitioned by columns
> str_date(DATE) and str_hour(INT). I want to rename the partitioned columns
> to call_date and call_hour.
>
>
>
> I am using the below command to alter the partitioned column name: -
>
>
>
> ALTER TABLE siplogs_partitioned PARTITION str_date RENAME TO PARTITION
> call_date;
>
>
>
> When I run the above command I am getting an error : -
>
>
>
> FAILED: ParseException line 1:12 cannot recognize input near
> 'siplogs_partitioned' 'PARTITION' 'str_date' in alter table partition
> statement
>
>
>
> Is the “ALTER TABLE” usage correct to rename the partitioned column names?
>
>
>
> Any pointer or help is appreciated.
>
>
>
> Thanks,
>
> Manish
>