@Override
  public void onDropPartition(DropPartitionEvent partitionEvent)  throws MetaException {
    Table table = partitionEvent.getTable();
    EnvironmentContext context = partitionEvent.getEnvironmentContext();

    if (TxnUtils.isTransactionalTable(table)) {
      txnHandler = getTxnHandler();
      txnHandler.cleanupRecords(HiveObjectType.PARTITION, null, table, partitionEvent.getPartitionIterator());

      if (!partitionEvent.getDeleteData()) {
        long currentTxn = getTxnId(context);
        
        if (currentTxn > 0) {
          long writeId = getWriteId(context);
          try {
            CompactionRequest rqst = new CompactionRequest(
              table.getDbName(), table.getTableName(), CompactionType.MAJOR);
            rqst.setRunas(TxnUtils.findUserToRunAs(table.getSd().getLocation(), table, conf));
            rqst.putToProperties("ifPurge", Boolean.toString(isMustPurge(context, table)));

            Iterator<Partition> partitionIterator = partitionEvent.getPartitionIterator();
            while (partitionIterator.hasNext()) {
              Partition p = partitionIterator.next();

              List<FieldSchema> partCols = partitionEvent.getTable().getPartitionKeys();  // partition columns
              List<String> partVals = p.getValues();
              rqst.setPartitionname(Warehouse.makePartName(partCols, partVals));
              rqst.putToProperties("location", p.getSd().getLocation());

              txnHandler.submitForCleanup(rqst, writeId, currentTxn);
            }
          } catch (InterruptedException | IOException e) {
            throwMetaException(e);
          }
        }
      }
    }
  }
It handles cleanup of dropped partition/table/database in ACID related metastore tables
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java