|
|
-
Changing table types from managed to external
Babe Ruth 2012-08-07, 06:08
Hello, I created a managed table in HIVE when i intended for it to be external, is it possible for me to change the table back to external? OR do I have to copy the data to a new directory, drop the table, then copy it back?
Thanks,George
+
Babe Ruth 2012-08-07, 06:08
-
Re: Changing table types from managed to external
Igor Tatarinov 2012-08-07, 06:26
Try ALTER TABLE <table> SET TBLPROPERTIES('EXTERNAL'='TRUE');
It worked for me.
igor decide.com
On Mon, Aug 6, 2012 at 11:08 PM, Babe Ruth <[EMAIL PROTECTED]>wrote:
> Hello, > I created a managed table in HIVE when i intended for it to be external, > is it possible for me to change the table back to external? > > OR do I have to copy the data to a new directory, drop the table, then > copy it back? > > > Thanks, > George >
+
Igor Tatarinov 2012-08-07, 06:26
-
Re:Changing table types from managed to external
long 2012-08-07, 06:13
Hi, George, I think that's the only way you can do now. -- Best Regards, longmans
At 2012-08-07 14:08:09,"Babe Ruth" <[EMAIL PROTECTED]> wrote:
Hello, I created a managed table in HIVE when i intended for it to be external, is it possible for me to change the table back to external? OR do I have to copy the data to a new directory, drop the table, then copy it back? Thanks, George
-
Re: Changing table types from managed to external
Jan Dolinár 2012-08-07, 06:21
Hi George,
You can save yourself one copying. Just create a new external table with different name, fill it with data (either by copying or query like INSERT OVERWRITE DIRECTORY '/new/table/path' SELECT * FROM oldtable), drop the old one and then rename the new one to the desired name:
ALTER TABLE table_name RENAME TO new_table_name;
Best regards, Jan
On Tue, Aug 7, 2012 at 8:13 AM, long <[EMAIL PROTECTED]> wrote:
> Hi, George, > I think that's the only way you can do now. > > -- > Best Regards, > longmans > > At 2012-08-07 14:08:09,"Babe Ruth" <[EMAIL PROTECTED]> wrote: > > Hello, > I created a managed table in HIVE when i intended for it to be external, > is it possible for me to change the table back to external? > > OR do I have to copy the data to a new directory, drop the table, then > copy it back? > > > Thanks, > George > > > >
+
Jan Dolinár 2012-08-07, 06:21
|
|