You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Naveen Gangam (Jira)" <ji...@apache.org> on 2021/05/11 03:15:00 UTC
[jira] [Commented] (HIVE-24920) TRANSLATED_TO_EXTERNAL tables may
write to the same location
[ https://issues.apache.org/jira/browse/HIVE-24920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17342267#comment-17342267 ]
Naveen Gangam commented on HIVE-24920:
--------------------------------------
[~kgyrtkirk] an alternate approach which I think might be cleaner is to have AlterTableHandler treat such tables with (“TRANSLATED_TO_EXTERNAL” or (type=“EXTERNAL” + “external.table.purge=true”)) same as Managed/ACID tables? i.e. we relocate these tables on a rename just like we do for managed tables today.
create table test; --> table located in "test" directory
alter table test rename to test_renamed; --> because this table has property "TRANSLATED_TO_EXTERNAL" and/or "external.table.purge=true", we relocate this table data from dir "test" to dir "test_renamed"
create table test; --> creates a new table with dir "test"
> TRANSLATED_TO_EXTERNAL tables may write to the same location
> ------------------------------------------------------------
>
> Key: HIVE-24920
> URL: https://issues.apache.org/jira/browse/HIVE-24920
> Project: Hive
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {code}
> create table t (a integer);
> insert into t values(1);
> alter table t rename to t2;
> create table t (a integer); -- I expected an exception from this command (location already exists) but because its an external table no exception
> insert into t values(2);
> select * from t; -- shows 1 and 2
> drop table t2; -- wipes out data location
> select * from t; -- empty resultset
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)