private void collectCommitInformation(TezWork work) throws IOException, TezException {
    for (BaseWork w : work.getAllWork()) {
      JobConf jobConf = workToConf.get(w);
      Vertex vertex = workToVertex.get(w);
      boolean hasIcebergCommitter = Optional.ofNullable(jobConf).map(JobConf::getOutputCommitter)
          .map(Object::getClass).map(Class::getName)
          .filter(name -> name.endsWith("HiveIcebergNoJobCommitter")).isPresent();
      // we should only consider jobs with Iceberg output committer and a data sink
      if (hasIcebergCommitter && !vertex.getDataSinks().isEmpty()) {
        VertexStatus status = dagClient.getVertexStatus(vertex.getName(), EnumSet.of(StatusGetOpts.GET_COUNTERS));
        String[] jobIdParts = status.getId().split("_");
        // status.getId() returns something like: vertex_1617722404520_0001_1_00
        // this should be transformed to a parsable JobID: job_16177224045200_0001
        int vertexId = Integer.parseInt(jobIdParts[jobIdParts.length - 1]);
        String jobId = String.format(JOB_ID_TEMPLATE, jobIdParts[1], vertexId, jobIdParts[2]);

        List<String> tables = new ArrayList<>();
        Map<String, String> icebergProperties = new HashMap<>();
        for (Map.Entry<String, String> entry : jobConf) {
          if (entry.getKey().startsWith(ICEBERG_SERIALIZED_TABLE_PREFIX)) {
            // get all target tables this vertex wrote to
            tables.add(entry.getKey().substring(ICEBERG_SERIALIZED_TABLE_PREFIX.length()));
          } else if (entry.getKey().startsWith(ICEBERG_PROPERTY_PREFIX)) {
            // find iceberg props in jobConf as they can be needed, but not available, during job commit
            icebergProperties.put(entry.getKey(), entry.getValue());
          }
        }

        // save information for each target table
        tables.forEach(table -> SessionStateUtil.addCommitInfo(jobConf, table, jobId,
            status.getProgress().getSucceededTaskCount(), icebergProperties));
      }
    }
  }
Making TezTask backward compatible with the old MR-based Task API (ExecDriver/MapRedTask)
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java