[ https://issues.apache.org/jira/browse/HIVE-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538608#comment-13538608 ]
Phabricator commented on HIVE-446: ---------------------------------- mgrover has commented on the revision "HIVE-446 [jira] Implement TRUNCATE". INLINE COMMENTS ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:3912 -rmr is deprecated. I think the new hip thing to do is "rm -r". Keep in mind though that if hive is being used with really old versions of hadoop, rm -r may not work, so some version matching needs to happen here. If we leave it the way it is, then users will see a deprecation warning. I would prefer that not to be the case (btw, that's presently the case with insert overwrite but HIVE-3701 plans to change that) ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java:727 Ok, we should add a test that verifies that something like this works: hive>use default; hive>truncate some_other_db.my_table; ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java:249 I am a little confused here. The code seems to indicate that this only works managed, native tables. For example, you can't have a HBase table (using HBase storage handler) being truncated with this command, can you? If so, should we have make error messages for those too? ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java:749 Check for non-native tables here? ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:3913 Touché! Since we preserve the metadata, we are preserving it for partitions as well. So, it makes sense to create empty directories for partitions that the metastore thinks exist. ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java:755 This could be a bottleneck if the number of partitions is large. Can't it? Is there an alternative to adding each of the partitions individually? Can we still not do outputs.add(new WriteEntity(table)); ? REVISION DETAIL https://reviews.facebook.net/D7371 To: JIRA, navis Cc: njain, mgrover > Implement TRUNCATE > ------------------ > > Key: HIVE-446 > URL: https://issues.apache.org/jira/browse/HIVE-446 > Project: Hive > Issue Type: New Feature > Components: Query Processor > Reporter: Prasad Chakka > Assignee: Navis > Attachments: HIVE-446.D7371.1.patch, HIVE-446.D7371.2.patch > > > truncate the data but leave the table and metadata intact. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira