SourabhBadhya commented on code in PR #4672:
URL: https://github.com/apache/hive/pull/4672#discussion_r1336737876


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/truncate/TruncateTableAnalyzer.java:
##########
@@ -137,9 +159,19 @@ private void addTruncateTableOutputs(ASTNode root, Table 
table, Map<String, Stri
       }
     } else {
       if (AlterTableUtils.isFullPartitionSpec(table, partitionSpec)) {
-        validatePartSpec(table, partitionSpec, (ASTNode) root.getChild(1), 
conf, true);
-        Partition partition = PartitionUtils.getPartition(db, table, 
partitionSpec, true);
-        outputs.add(new WriteEntity(partition, writeType));
+        if (table.getStorageHandler() != null && 
table.getStorageHandler().alwaysUnpartitioned()) {

Review Comment:
   > I agree, but if you dont have alwaysUnpartitioned here, are you suggesting 
making a storageHandler.getPartitionsByFilter call from getPartitions API?
   
   Implemented this. Done.



##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/truncate/TruncateTableAnalyzer.java:
##########
@@ -338,4 +370,56 @@ private void addStatTask(ASTNode root, Table table, Path 
oldPartitionLocation, P
       moveTask.addDependentTask(statTask);
     }
   }
+
+  public StringBuilder constructDeleteQuery(Table table, Map<String, String> 
partitionSpec) throws SemanticException {
+    String qualifiedTableName = 
HiveTableName.ofNullable(HiveUtils.unparseIdentifier(table.getTableName(), 
this.conf),

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to