saihemanth-cloudera commented on code in PR #5851:
URL: https://github.com/apache/hive/pull/5851#discussion_r2612465154


##########
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:
   Since these arguments are coming from client, string concatinations can lead 
to SQL injection, can you use prepared statements?



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