mgrover has commented on the revision "
HIVE-446 [jira] Implement TRUNCATE".
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:
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
To: JIRA, navis
Cc: njain, mgrover