[ https://issues.apache.org/jira/browse/HIVE-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064966#comment-13064966 ]
jirapos...@reviews.apache.org commented on HIVE-2247: ----------------------------------------------------- ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1105/#review1052 ----------------------------------------------------------- trunk/metastore/if/hive_metastore.thrift <https://reviews.apache.org/r/1105/#comment2131> Do we really need a new metastore function? Can we just use alter_partition()? trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java <https://reviews.apache.org/r/1105/#comment2126> This doesn't seem to be correct to me. The partition should always have SerDe. Even if it doesn't have one, copying from the table's Serde doesn't seem to be the right thing to do. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java <https://reviews.apache.org/r/1105/#comment2127> Also, it doesn't seem to be correct to me here. There shouldn't be any case that we need to create new directory for the renamed partitions. Renaming should just change the name, with all other attributes kept. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java <https://reviews.apache.org/r/1105/#comment2128> I can't understand those codes. What you try to do here? trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java <https://reviews.apache.org/r/1105/#comment2129> Since we only need old part spec and new part spec, why we make a new Partition object at all? trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java <https://reviews.apache.org/r/1105/#comment2130> why we still continue when tab is null? trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java <https://reviews.apache.org/r/1105/#comment2125> Privilege.ALTER_METADATA doesn't sound right to me here. Can you use Privilede.DROP and Priviledge.CREATE? trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/RenamePartitionDesc.java <https://reviews.apache.org/r/1105/#comment2124> Looks like you copied from the file AddPartitionDesc, but do you need all those class members for renaming partition? - Siying On 2011-07-13 23:04:47, Weiyan Wang wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/1105/ bq. ----------------------------------------------------------- bq. bq. (Updated 2011-07-13 23:04:47) bq. bq. bq. Review request for Siying Dong. bq. bq. bq. Summary bq. ------- bq. bq. Implement ALTER TABLE PARTITION RENAME function to rename a partition. bq. Add HiveQL syntax "ALTER TABLE bar PARTITION (k1='v1', k2='v2') RENAME TO PARTITION (k1='v3', k2='v4');" bq. This is my first Hive diff, I just learn everything from existing codebase and may not have a good understanding on it. bq. Feel free to inform me if I make something wrong. Thanks bq. bq. bq. This addresses bug HIVE-2247. bq. https://issues.apache.org/jira/browse/HIVE-2247 bq. bq. bq. Diffs bq. ----- bq. bq. trunk/metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php 1145366 bq. trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp 1145366 bq. trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java 1145366 bq. trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp 1145366 bq. trunk/metastore/if/hive_metastore.thrift 1145366 bq. trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h 1145366 bq. trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb 1145366 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1145366 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1145366 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1145366 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1145366 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1145366 bq. trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java 1145366 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/RenamePartitionDesc.java PRE-CREATION bq. trunk/ql/src/test/queries/clientnegative/alter_rename_partition_failure.q PRE-CREATION bq. trunk/ql/src/test/queries/clientnegative/alter_rename_partition_failure2.q PRE-CREATION bq. trunk/ql/src/test/queries/clientnegative/alter_rename_partition_failure3.q PRE-CREATION bq. trunk/ql/src/test/queries/clientpositive/alter_rename_partition.q PRE-CREATION bq. trunk/ql/src/test/results/clientnegative/alter_rename_partition_failure.q.out PRE-CREATION bq. trunk/ql/src/test/results/clientnegative/alter_rename_partition_failure2.q.out PRE-CREATION bq. trunk/ql/src/test/results/clientnegative/alter_rename_partition_failure3.q.out PRE-CREATION bq. trunk/ql/src/test/results/clientpositive/alter_rename_partition.q.out PRE-CREATION bq. trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote 1145366 bq. trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py 1145366 bq. bq. Diff: https://reviews.apache.org/r/1105/diff bq. bq. bq. Testing bq. ------- bq. bq. Add a partition A in the table bq. Rename partition A to partition B bq. Show the partitions in the table, it returns partition B. bq. SELECT the data from partition A, it returns no results bq. SELECT the data from partition B, it returns the data originally stored in partition A bq. bq. bq. Thanks, bq. bq. Weiyan bq. bq. > ALTER TABLE RENAME PARTITION > ---------------------------- > > Key: HIVE-2247 > URL: https://issues.apache.org/jira/browse/HIVE-2247 > Project: Hive > Issue Type: New Feature > Reporter: Siying Dong > Assignee: Weiyan Wang > Attachments: HIVE-2247.3.patch.txt > > > We need a ALTER TABLE TABLE RENAME PARTITIONfunction that is similar t ALTER > TABLE RENAME. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira