dengzhhu653 commented on code in PR #5851:
URL: https://github.com/apache/hive/pull/5851#discussion_r2622380759


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java:
##########
@@ -2864,6 +2865,58 @@ public List<Void> run(List<String> input) throws 
MetaException {
     });
   }
 
+  /**
+   * Drop partitions by the given table id, and return the locations that 
outside of the baseLocationToNotShow
+   * @param tableId the table id
+   * @param baseLocationToNotShow the parent directory
+   * @return locations that outside of the parent directory
+   */
+  public List<String> dropAllPartitionsAndGetLocations(Long tableId, String 
baseLocationToNotShow, StringBuffer message) throws MetaException {
+    String queryText =
+        "select " + PARTITIONS + ".\"PART_ID\", " + SDS + ".\"LOCATION\" from 
" + PARTITIONS
+            + (baseLocationToNotShow != null ? (" join " + SDS + " on " + 
PARTITIONS + ".\"SD_ID\" = " + SDS + ".\"SD_ID\" ") : "")
+            + " where \"TBL_ID\" = " + tableId;

Review Comment:
   The `tableId` comes from `Table`, client input is catalog, db, and table 
name, the client cannot change/inspect the table id 



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