@Override
  public void preDropPartitions(org.apache.hadoop.hive.metastore.api.Table hmsTable,
      EnvironmentContext context,
      List<org.apache.commons.lang3.tuple.Pair<Integer, byte[]>> partExprs)
      throws MetaException {
    Table icebergTbl = IcebergTableUtil.getTable(conf, hmsTable);
    DeleteFiles deleteFiles = icebergTbl.newDelete();
    List<Expression> expressions = partExprs.stream().map(partExpr -> {
      ExprNodeDesc exprNodeDesc = SerializationUtilities
          .deserializeObjectWithTypeInformation(partExpr.getRight(), true);
      SearchArgument sarg = ConvertAstToSearchArg.create(conf, (ExprNodeGenericFuncDesc) exprNodeDesc);
      validatePartitionSpec(sarg, icebergTbl.spec());
      return HiveIcebergFilterFactory.generateFilterExpression(sarg);
    }).collect(Collectors.toList());
    PartitionsTable partitionsTable = (PartitionsTable) MetadataTableUtils
        .createMetadataTableInstance(icebergTbl, MetadataTableType.PARTITIONS);
    List<PartitionData> partitionList = Lists.newArrayList();
    Expression finalExp = Expressions.alwaysFalse();
    PartitionSpec pSpec = icebergTbl.spec();
    for (int index = 0; index < expressions.size(); index++) {
      finalExp = Expressions.or(finalExp, expressions.get(index));
    }
    ResidualEvaluator resEval = ResidualEvaluator.of(icebergTbl.spec(), finalExp, false);
    try (CloseableIterable<FileScanTask> fileScanTasks = partitionsTable.newScan().planFiles()) {
      fileScanTasks.forEach(task ->
          partitionList.addAll(Sets.newHashSet(CloseableIterable.transform(task.asDataTask().rows(), row -> {
            StructProjection data = row.get(0, StructProjection.class);
            return IcebergTableUtil.toPartitionData(data, pSpec.partitionType());
          })).stream()
             .filter(partitionData -> resEval.residualFor(partitionData).isEquivalentTo(Expressions.alwaysTrue()))
             .collect(Collectors.toSet())));

      Expression partitionSetFilter = Expressions.alwaysFalse();
      for (PartitionData partitionData : partitionList) {
        Expression partFilter = Expressions.alwaysTrue();
        for (int index = 0; index < pSpec.fields().size(); index++) {
          PartitionField field = icebergTbl.spec().fields().get(index);
          UnboundPredicate<Object> equal = getPartitionPredicate(partitionData, field, index, icebergTbl.schema());
          partFilter = Expressions.and(partFilter, equal);
        }
        partitionSetFilter = Expressions.or(partitionSetFilter, partFilter);
      }

      deleteFiles.deleteFromRowFilter(partitionSetFilter);
      deleteFiles.commit();
    } catch (IOException e) {
      throw new MetaException(String.format("Error while fetching the partitions due to: %s", e));
    }
    context.putToProperties(HiveMetaStoreClient.SKIP_DROP_PARTITION, "true");
  }
Calculates the properties we would like to send to the catalog.
<ul>
<li>The base of the properties is the properties stored at the Hive Metastore for the given table
<li>We add the {@link Catalogs#LOCATION} as the table location
<li>We add the {@link Catalogs#NAME} as TableIdentifier defined by the database name and table name
<li>We add the serdeProperties of the HMS table
<li>We remove some parameters that we don't want to push down to the Iceberg table props
</ul>
@param hmsTable Table for which we are calculating the properties
@return The properties we can provide for Iceberg functions, like {@link Catalogs}
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java