You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by sky88088 <sk...@hotmail.com> on 2014/08/06 10:47:14 UTC

Error when altering table not in default database

Hi all,        I encounter error when I was trying to alter a table not in default database.
        The command I type is        alter table db1.table_A drop partition (id=1);                Error info is        FAILED: ParseException line 2:12 cannot recognize input near 'db1' '.' 'table_A' in alter table statement                    Is this a bug of hive? Any suggestions about how to solve it?
 Best Regards,ypg 		 	   		  

RE: Error when altering table not in default database

Posted by sky88088 <sk...@hotmail.com>.
Thank you! It works.

 Best Regards,ypg

Date: Wed, 6 Aug 2014 15:48:57 -0400
Subject: Re: Error when altering table not in default database
From: leftyleverenz@gmail.com
To: user@hive.apache.org

ALTER TABLE does not yet take a database qualifier on the table name, but it will soon (see HIVE-2584 and HIVE-4064).  In the meantime, you can set the database before issuing ALTER TABLE, then reset it afterwards:





USE database_name;

ALTER TABLE table_A DROP PARTITION (id-1);

USE DEFAULT;
-- Lefty


On Wed, Aug 6, 2014 at 4:47 AM, sky88088 <sk...@hotmail.com> wrote:




Hi all,        I encounter error when I was trying to alter a table not in default database.
        The command I type is        alter table db1.table_A drop partition (id=1);
                Error info is        FAILED: ParseException line 2:12 cannot recognize input near 'db1' '.' 'table_A' in alter table statement            
        Is this a bug of hive? Any suggestions about how to solve it?
 
Best Regards,
ypg 		 	   		  

 		 	   		  

Re: Error when altering table not in default database

Posted by Lefty Leverenz <le...@gmail.com>.
ALTER TABLE does not yet take a database qualifier on the table name, but
it will soon (see HIVE-2584
<https://issues.apache.org/jira/browse/HIVE-2584> and HIVE-4064
<https://issues.apache.org/jira/browse/HIVE-4064>).  In the meantime, you
can set the database before issuing ALTER TABLE, then reset it afterwards:
USE database_name;
ALTER TABLE table_A DROP PARTITION (id-1);
USE DEFAULT;

-- Lefty


On Wed, Aug 6, 2014 at 4:47 AM, sky88088 <sk...@hotmail.com> wrote:

> Hi all,
>         I encounter error when I was trying to alter a table not in
> default database.
>
>         The command I type is
>         *alter table db1.table_A drop partition (id=1);*
>
>         Error info is
>         *FAILED: ParseException line 2:12 cannot recognize input near
> 'db1' '.' 'table_A' in alter table statement*
>
>         Is this a bug of hive? Any suggestions about how to solve it?
>
>
> Best Regards,
> ypg
>