@Override
  public List<String> listPartitionNamesByFilter(String catName, String dbName, String tblName,
      GetPartitionsArgs args) throws MetaException, NoSuchObjectException {

    catName = normalizeIdentifier(catName);
    dbName = normalizeIdentifier(dbName);
    tblName = normalizeIdentifier(tblName);

    MTable mTable = ensureGetMTable(catName, dbName, tblName);
    List<FieldSchema> partitionKeys = convertToFieldSchemas(mTable.getPartitionKeys());
    String filter = args.getFilter();
    final ExpressionTree tree = (filter != null && !filter.isEmpty())
        ? PartFilterExprUtil.parseFilterTree(filter) : ExpressionTree.EMPTY_TREE;
    return new GetListHelper<String>(catName, dbName, tblName, true, true) {
      private final SqlFilterForPushdown filter = new SqlFilterForPushdown();

      @Override
      protected boolean canUseDirectSql(GetHelper<List<String>> ctx) throws MetaException {
        return directSql.generateSqlFilterForPushdown(catName, dbName, tblName,
            partitionKeys, tree, null, filter);
      }

      @Override
      protected List<String> getSqlResult(GetHelper<List<String>> ctx) throws MetaException {
        return directSql.getPartitionNamesViaSql(filter, partitionKeys,
            getDefaultPartitionName(args.getDefaultPartName()), null, args.getMax());
      }

      @Override
      protected List<String> getJdoResult(GetHelper<List<String>> ctx)
          throws MetaException, NoSuchObjectException, InvalidObjectException {
        return getPartitionNamesViaOrm(catName, dbName, tblName, tree, null,
            args.getMax(), true, partitionKeys);
      }
    }.run(false);
  }
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