private List<String> getPartNamesPrunedByExpr(Table table, boolean isJdoQuery) throws MetaException {
        int max = isEmptyFilter ? maxParts : -1;
        List<String> result;
        if (isJdoQuery) {
          result = getPartitionNamesViaOrm(catName, dbName, tblName, ExpressionTree.EMPTY_TREE,
              order, max, true, table.getPartitionKeys());
        } else {
          SqlFilterForPushdown filter = new SqlFilterForPushdown(table, false);
          result = directSql.getPartitionNamesViaSql(filter, table.getPartitionKeys(),
              defaultPartitionName, order, max);
        }
        if (!isEmptyFilter) {
          prunePartitionNamesByExpr(catName, dbName, tblName, result,
              new GetPartitionsArgs.GetPartitionsArgsBuilder()
                  .expr(exprBytes).defaultPartName(defaultPartName).max(maxParts).build());
        }
        return result;
      }
Drop an MPartition and cascade deletes (e.g., delete partition privilege grants,
  drop the storage descriptor cleanly, etc.)
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java