private void dropPartitions(boolean isRepl) throws HiveException {
    // ifExists is currently verified in AlterTableDropPartitionAnalyzer
    TableName tableName = HiveTableName.of(desc.getTableName());

    List<Pair<Integer, byte[]>> partitionExpressions = new ArrayList<>(desc.getPartSpecs().size());
    for (AlterTableDropPartitionDesc.PartitionDesc partSpec : desc.getPartSpecs()) {
      partitionExpressions.add(Pair.of(partSpec.getPrefixLength(),
          SerializationUtilities.serializeObjectWithTypeInformation(partSpec.getPartSpec())));
    }

    PartitionDropOptions options =
        PartitionDropOptions.instance().deleteData(desc.getDeleteData())
          .ifExists(true).purgeData(desc.getIfPurge());
    List<Partition> droppedPartitions = context.getDb().dropPartitions(tableName.getDb(), tableName.getTable(),
        partitionExpressions, options);

    if (isRepl) {
      LOG.info("Dropped {} partitions for replication.", droppedPartitions.size());
      // If replaying an event, we need not to bother about the further steps, we can return from here itself.
      return;
    }

    ProactiveEviction.Request.Builder llapEvictRequestBuilder = LlapHiveUtils.isLlapMode(context.getConf()) ?
        ProactiveEviction.Request.Builder.create() : null;

    for (Partition partition : droppedPartitions) {
      context.getConsole().printInfo("Dropped the partition " + partition.getName());
      // We have already locked the table, don't lock the partitions.
      DDLUtils.addIfAbsentByName(new WriteEntity(partition, WriteEntity.WriteType.DDL_NO_LOCK), context);

      if (llapEvictRequestBuilder != null) {
        llapEvictRequestBuilder.addPartitionOfATable(tableName.getDb(), tableName.getTable(), partition.getSpec());
      }
    }

    if (llapEvictRequestBuilder != null) {
      ProactiveEviction.evict(context.getConf(), llapEvictRequestBuilder.build());
    }
  }
ALTER TABLE DROP PARTITION ... FOR REPLICATION(x) behaves as a DROP PARTITION IF OLDER THAN x

So, we check each partition that matches our DropTableDesc.getPartSpecs(), and drop it only
if it's older than the event that spawned this replicated request to drop partition
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/drop/AlterTableDropPartitionOperation.java