[ https://issues.apache.org/jira/browse/HIVE-13186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172867#comment-15172867 ]
Wei Zheng commented on HIVE-13186: ---------------------------------- Operations related to table creation will normally lowercase the db/table names before doing certain tasks. But for ALTER TABLE things are different. Specifically, if a table is renamed and given a new mixed-case name, HDFS directory is created with mixed case as is. That is not consistent to CREATE TABLE behavior. Moreover, this will cause issue for example if users want to load data directly to HDFS under the table directory, or use some scripts to check data size on HDFS path. Example {code} hive> create table OldName (a int); OK Time taken: 3.125 seconds hive> desc formatted oldname; OK # col_name data_type comment a int # Detailed Table Information Database: default Owner: hive CreateTime: Mon Feb 29 23:29:33 UTC 2016 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Location: hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/oldname Table Type: MANAGED_TABLE Table Parameters: transient_lastDdlTime 1456788573 # Storage Information SerDe Library: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe InputFormat: org.apache.hadoop.mapred.TextInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] Storage Desc Params: serialization.format 1 Time taken: 0.754 seconds, Fetched: 26 row(s) hive> alter table oldname rename to newName; OK Time taken: 1.625 seconds hive> desc formatted newname; OK # col_name data_type comment a int # Detailed Table Information Database: default Owner: hive CreateTime: Mon Feb 29 23:29:33 UTC 2016 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Location: hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/newName Table Type: MANAGED_TABLE Table Parameters: last_modified_by hive last_modified_time 1456788604 transient_lastDdlTime 1456788604 # Storage Information SerDe Library: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe InputFormat: org.apache.hadoop.mapred.TextInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] Storage Desc Params: serialization.format 1 Time taken: 0.485 seconds, Fetched: 28 row(s) {code} > ALTER TABLE RENAME should lowercase table name and hdfs location > ---------------------------------------------------------------- > > Key: HIVE-13186 > URL: https://issues.apache.org/jira/browse/HIVE-13186 > Project: Hive > Issue Type: Bug > Components: Hive > Affects Versions: 2.0.0 > Reporter: Wei Zheng > Assignee: Wei Zheng > -- This message was sent by Atlassian JIRA (v6.3.4#6332)