[jira] Commented: (HIVE-1116) alter table rename should rename hdfs location of table as well
[ https://issues.apache.org/jira/browse/HIVE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12863436#action_12863436 ] John Sichi commented on HIVE-1116: -- Joydeep is correct; there is still a bug here. This works: create table a(i int); alter table a rename to b; describe extended a; But this does not: create table a(i int); create table c like a; alter table c rename to d; describe extended d; Nor does this: create table a (int); alter table a set tblproperties ('EXTERNAL' = 'FALSE'); alter table a rename to e; describe extended e; Here's what is going on. (1) When ALTER TABLE RENAME sees a table with the 'EXTERNAL' property (regardless of the value), it treats it as an external table and does not do the relocation. This is incorrect, since when 'EXTERNAL' = 'FALSE', it is not an external table. (2) CREATE TABLE LIKE always adds an EXTERNAL property (setting it to FALSE unless the table is an external table). So, the bug will typically only show up on a table which was originally created with CREATE TABLE LIKE and then renamed. > alter table rename should rename hdfs location of table as well > --- > > Key: HIVE-1116 > URL: https://issues.apache.org/jira/browse/HIVE-1116 > Project: Hadoop Hive > Issue Type: Bug >Reporter: Joydeep Sen Sarma > > if the location is not an external location - this would be safer. > the problem right now is that it's tricky to use the drop and rename way of > writing new data into a table. consider: > Initialization block: > drop table a_tmp > create table a_tmp like a; > Loading block: > load data into a_tmp; > drop table a; > alter table a_tmp rename to a; > this looks safe. but it's not. if one runs this multiple times - then data is > lost (since 'a' is pointing to 'a_tmp''s location after any iteration. and > dropping table 'a' blows away loaded data in the next iteration). > if the location is being managed by Hive - then 'rename' should switch > location as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1116) alter table rename should rename hdfs location of table as well
[ https://issues.apache.org/jira/browse/HIVE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806073#action_12806073 ] Joydeep Sen Sarma commented on HIVE-1116: - yeah - positive. it might work 'once'. but if u repeat the recipe - it will fail because 'a' points to 'a_tmp' next time. > alter table rename should rename hdfs location of table as well > --- > > Key: HIVE-1116 > URL: https://issues.apache.org/jira/browse/HIVE-1116 > Project: Hadoop Hive > Issue Type: Bug >Reporter: Joydeep Sen Sarma > > if the location is not an external location - this would be safer. > the problem right now is that it's tricky to use the drop and rename way of > writing new data into a table. consider: > Initialization block: > drop table a_tmp > create table a_tmp like a; > Loading block: > load data into a_tmp; > drop table a; > alter table a_tmp rename to a; > this looks safe. but it's not. if one runs this multiple times - then data is > lost (since 'a' is pointing to 'a_tmp''s location after any iteration. and > dropping table 'a' blows away loaded data in the next iteration). > if the location is being managed by Hive - then 'rename' should switch > location as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1116) alter table rename should rename hdfs location of table as well
[ https://issues.apache.org/jira/browse/HIVE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806075#action_12806075 ] Joydeep Sen Sarma commented on HIVE-1116: - interesting - i am hitting on our internal clusters. 592 seems pretty old. > alter table rename should rename hdfs location of table as well > --- > > Key: HIVE-1116 > URL: https://issues.apache.org/jira/browse/HIVE-1116 > Project: Hadoop Hive > Issue Type: Bug >Reporter: Joydeep Sen Sarma > > if the location is not an external location - this would be safer. > the problem right now is that it's tricky to use the drop and rename way of > writing new data into a table. consider: > Initialization block: > drop table a_tmp > create table a_tmp like a; > Loading block: > load data into a_tmp; > drop table a; > alter table a_tmp rename to a; > this looks safe. but it's not. if one runs this multiple times - then data is > lost (since 'a' is pointing to 'a_tmp''s location after any iteration. and > dropping table 'a' blows away loaded data in the next iteration). > if the location is being managed by Hive - then 'rename' should switch > location as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1116) alter table rename should rename hdfs location of table as well
[ https://issues.apache.org/jira/browse/HIVE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806074#action_12806074 ] Joydeep Sen Sarma commented on HIVE-1116: - yeah - positive. it might work 'once'. but if u repeat the recipe - it will fail because 'a' points to 'a_tmp' next time. > alter table rename should rename hdfs location of table as well > --- > > Key: HIVE-1116 > URL: https://issues.apache.org/jira/browse/HIVE-1116 > Project: Hadoop Hive > Issue Type: Bug >Reporter: Joydeep Sen Sarma > > if the location is not an external location - this would be safer. > the problem right now is that it's tricky to use the drop and rename way of > writing new data into a table. consider: > Initialization block: > drop table a_tmp > create table a_tmp like a; > Loading block: > load data into a_tmp; > drop table a; > alter table a_tmp rename to a; > this looks safe. but it's not. if one runs this multiple times - then data is > lost (since 'a' is pointing to 'a_tmp''s location after any iteration. and > dropping table 'a' blows away loaded data in the next iteration). > if the location is being managed by Hive - then 'rename' should switch > location as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1116) alter table rename should rename hdfs location of table as well
[ https://issues.apache.org/jira/browse/HIVE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805985#action_12805985 ] Prasad Chakka commented on HIVE-1116: - I remember doing this quite sometime ago(only for non-external tables). Are you sure it doesn't work in any scenario? > alter table rename should rename hdfs location of table as well > --- > > Key: HIVE-1116 > URL: https://issues.apache.org/jira/browse/HIVE-1116 > Project: Hadoop Hive > Issue Type: Bug >Reporter: Joydeep Sen Sarma > > if the location is not an external location - this would be safer. > the problem right now is that it's tricky to use the drop and rename way of > writing new data into a table. consider: > Initialization block: > drop table a_tmp > create table a_tmp like a; > Loading block: > load data into a_tmp; > drop table a; > alter table a_tmp rename to a; > this looks safe. but it's not. if one runs this multiple times - then data is > lost (since 'a' is pointing to 'a_tmp''s location after any iteration. and > dropping table 'a' blows away loaded data in the next iteration). > if the location is being managed by Hive - then 'rename' should switch > location as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.