@Override
  public void appendSummary(TableName tableName, MetadataTableSummary tableSummary) {
    Objects.requireNonNull(tableName);
    if (summaryRetrievers == null || catalog == null) {
      throw new IllegalStateException("The Iceberg summary handler hasn't been initialized yet!");
    }
    LOG.debug("Starting to collect the summary for the table: {}", tableName);
    final TableIdentifier tblId = TableIdentifier.of(tableName.getDb(), tableName.getTable());
    PrivilegedAction<Long> action = () -> {
      long start = System.currentTimeMillis();
      Table table;
      try {
        table = catalog.loadTable(tblId);
        this.summaryRetrievers.forEach(retriever ->
            retriever.getMetaSummary(table, tableSummary));
      } catch (Exception e) {
        LOG.warn("Error while loading the table: " + tableName, e);
        tableSummary.setDropped(true);
      }
      return System.currentTimeMillis() - start;
    };
    long timeSpent = ugi != null ? ugi.doAs(action) : action.run();
    LOG.debug("Finished the summary collection in {} ms for table: {}", timeSpent, tableName);
  }
Iceberg specific implementation of summary collector
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/metasummary/IcebergSummaryHandler.java