@Override
  public boolean canPerformMetadataDelete(org.apache.hadoop.hive.ql.metadata.Table hmsTable,
      String branchName, SearchArgument sarg) {
    Expression exp;
    try {
      exp = HiveIcebergFilterFactory.generateFilterExpression(sarg);
    } catch (UnsupportedOperationException e) {
      LOG.warn("Unable to create Iceberg filter," +
              " continuing without metadata delete: ", e);
      return false;
    }
    Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable());

    // The following code is inspired & copied from Iceberg's SparkTable.java#canDeleteUsingMetadata
    if (ExpressionUtil.selectsPartitions(exp, table, false)) {
      return true;
    }

    TableScan scan = table.newScan().filter(exp)
        .caseSensitive(false).includeColumnStats().ignoreResiduals();
    if (branchName != null) {
      scan.useRef(HiveUtils.getTableSnapshotRef(branchName));
    }

    try (CloseableIterable<FileScanTask> tasks = scan.planFiles()) {
      Map<Integer, Evaluator> evaluators = Maps.newHashMap();
      StrictMetricsEvaluator metricsEvaluator =
          new StrictMetricsEvaluator(SnapshotUtil.schemaFor(table, branchName), exp);

      return Iterables.all(tasks, task -> {
        DataFile file = task.file();
        PartitionSpec spec = task.spec();
        Evaluator evaluator = evaluators.computeIfAbsent(spec.specId(), specId ->
            new Evaluator(spec.partitionType(), Projections.strict(spec).project(exp)));
        return evaluator.eval(file.partition()) || metricsEvaluator.eval(file);
      });
    } catch (IOException ioe) {
      LOG.warn("Failed to close task iterable", ioe);
      return false;
    }
  }
A function to fetch the column information of the underlying column defined by the table format.
@param hmsTable A Hive table instance
@param colName Column name
@return An instance of ColumnInfo.
@throws SemanticException An exception is thrown when the column is not present, or if we unable to fetch
column type due to SerDeException, or if the associated field object inspector is not present.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java