deniskuzZ commented on code in PR #5173:
URL: https://github.com/apache/hive/pull/5173#discussion_r1550187078


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java:
##########
@@ -2079,34 +2081,40 @@ public void dropTable(String catName, String dbname, 
String name, boolean delete
   @Override
   public void truncateTable(String dbName, String tableName, List<String> 
partNames,
       String validWriteIds, long writeId, boolean deleteData) throws 
TException {
-    truncateTableInternal(getDefaultCatalog(conf),
-        dbName, tableName, partNames, validWriteIds, writeId, deleteData);
+    truncateTableInternal(getDefaultCatalog(conf), dbName, tableName, null, 
partNames, validWriteIds, writeId,
+        deleteData);
   }
 
   @Override
   public void truncateTable(String dbName, String tableName, List<String> 
partNames,
       String validWriteIds, long writeId) throws TException {
-    truncateTableInternal(getDefaultCatalog(conf),
-        dbName, tableName, partNames, validWriteIds, writeId, true);
+    truncateTableInternal(getDefaultCatalog(conf), dbName, tableName, null, 
partNames, validWriteIds, writeId, true);
   }
 
   @Override
   public void truncateTable(String dbName, String tableName, List<String> 
partNames) throws TException {
-    truncateTableInternal(getDefaultCatalog(conf), dbName, tableName, 
partNames, null, -1, true);
+    truncateTable(getDefaultCatalog(conf), dbName, tableName, partNames);
+  }
+
+  @Override
+  public void truncateTable(TableName table, List<String> partNames) throws 
TException {
+    truncateTableInternal(getDefaultCatalog(conf), table.getDb(), 
table.getTable(), table.getTableMetaRef(), partNames,
+        null, -1, true);
   }
 
   @Override
   public void truncateTable(String catName, String dbName, String tableName, 
List<String> partNames)
       throws TException {
-    truncateTableInternal(catName, dbName, tableName, partNames, null, -1, 
true);
+    truncateTableInternal(catName, dbName, tableName, null, partNames, null, 
-1, true);
   }
 
-  private void truncateTableInternal(String catName, String dbName, String 
tableName,
+  private void truncateTableInternal(String catName, String dbName, String 
tableName, String ref,
       List<String> partNames, String validWriteIds, long writeId, boolean 
deleteData)
           throws TException {
+    EnvironmentContext context = new EnvironmentContext();

Review Comment:
   don't move the EnvironmentContext, just add the `tableMetaRef`



-- 
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