[jira] [Commented] (HIVE-14909) Preserve the "parent location" of the table when an "alter table rename to " is submitted (the case when the db location is not specified and the Hive defult db is outside the same encrypted zone).

Tue, 25 Oct 2016 06:20:25 -0700

    [ 
https://issues.apache.org/jira/browse/HIVE-14909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15605293#comment-15605293
 ] 

Chaoyu Tang commented on HIVE-14909:
------------------------------------

That the TestSemanticAnalysis.testAlterTableRename failed in the precommit 
build is the old table was not created under its database directory in the 
test, will look into:
{code}
2016-10-25T02:53:40,484 DEBUG [main] log.PerfLogger: <PERFLOG 
method=alter_table_with_environment_context 
from=org.apache.hadoop.hive.metastore.RetryingHMSHandler>
2016-10-25T02:53:40,484  INFO [main] metastore.HiveMetaStore: 0: alter_table: 
db=default tbl=oldname newtbl=newNAME
2016-10-25T02:53:40,484  INFO [main] HiveMetaStore.audit: ugi=hiveptest 
ip=unknown-ip-addr      cmd=alter_table: db=default tbl=oldname newtbl=newNAME  
2016-10-25T02:53:40,491 DEBUG [main] metastore.HiveAlterHandler: HiveAlterTable 
is renaming default.oldname to default.newNAME
2016-10-25T02:53:40,496 DEBUG [main] metastore.HiveAlterHandler: Old table 
location: 
file:/home/hiveptest/104.197.110.94-hiveptest-0/apache-github-source-source/hcatalog/core/build/test/data/org.apache.hive.hcatalog.mapreduce.HCatBaseTest-1477389203834/warehouse/oldname
2016-10-25T02:53:40,496 DEBUG [main] metastore.HiveAlterHandler: New table 
location: 
file:/home/hiveptest/104.197.110.94-hiveptest-0/apache-github-source-source/hcatalog/core/build/test/data/org.apache.hive.hcatalog.mapreduce.HCatBaseTest-1477389203834/warehouse/oldname
2016-10-25T02:53:40,496 DEBUG [main] metastore.MetaStoreDirectSql: getDatabase: 
directsql returning db default 
locn[pfile:/home/hiveptest/104.197.110.94-hiveptest-0/apache-github-source-source/hcatalog/core/target/warehouse]
 desc [Default Hive database] owner [public] ownertype [ROLE]
2016-10-25T02:53:40,496 DEBUG [main] metastore.HiveAlterHandler: Old database 
location: 
pfile:/home/hiveptest/104.197.110.94-hiveptest-0/apache-github-source-source/hcatalog/core/target/warehouse
{code}

> Preserve the "parent location" of the table when an "alter table <table> 
> rename to <newname>" is submitted (the case when the db location is not 
> specified and the Hive defult db is outside the same encrypted zone).
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-14909
>                 URL: https://issues.apache.org/jira/browse/HIVE-14909
>             Project: Hive
>          Issue Type: Improvement
>          Components: Hive
>    Affects Versions: 1.1.0
>            Reporter: Adriano
>            Assignee: Chaoyu Tang
>         Attachments: HIVE-14909.1.patch, HIVE-14909.1.patch, 
> HIVE-14909.2.patch, HIVE-14909.patch, HIVE-14909.patch
>
>
> Alter Table operation for db_enc.rename_test failed to move data due to: 
> '/hdfs/encrypted_path/db_enc/rename_test can't be moved from an encryption 
> zone.'
> When Hive renames a managed table, it always creates the new renamed table 
> directory under its database directory in order to keep a db/table hierarchy. 
> In this case, the renamed table directory is created under "default db" 
> directory "hive/warehouse/". When Hive renames a managed table, it always 
> creates the new renamed table directory under its database directory in order 
> to keep a db/table hierarchy. In this case, the renamed table directory is 
> created under "default' db directory typically set as /hive/warehouse/ . 
> This error doesn't appear if first create a database which points to a 
> directory outside /hive/warehouse/, say '/hdfs/encrypted_path', you won't 
> have this problem. For example, 
> create database db_enc location '/hdfs/encrypted_path/db_enc; 
> use db_enc; 
> create table rename_test (...) location 
> '/hdfs/encrypted_path/db_enc/rename_test'; 
> alter table rename_test rename to test_rename; 
> The renamed test_rename directory is created under 
> /hdfs/encrypted_path/db_enc. 
> Considering that the encryption of a filesystem is part of the evolution 
> hardening of a system (where the system and the data contained can already 
> exists) and a db can be already created without location set (because it is 
> not strictly required)and the default db is outside the same encryption zone 
> (or in a no-encryption zone) the alter table rename operation will fail.
> Improvement:
> Preserve the "parent location" of the table when an "alter table <table> 
> rename to <newname>" is submitted (the case when the db location is not 
> specified and the Hive defult db is outside the same encrypted zone).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to