@SuppressWarnings("checkstyle:CyclomaticComplexity")
  private Map<String, String> getBasicStatistics(Partish partish, boolean quickStats) {
    Map<String, String> stats = Maps.newHashMap();

    org.apache.hadoop.hive.ql.metadata.Table hmsTable = partish.getTable();
    // For write queries where rows got modified, don't fetch from cache as values could have changed.
    Table table = getTable(hmsTable);
    Snapshot snapshot = IcebergTableUtil.getTableSnapshot(table, hmsTable);

    if (snapshot == null) {
      stats.put(StatsSetupConst.NUM_FILES, "0");
      stats.put(StatsSetupConst.ROW_COUNT, "0");
      stats.put(StatsSetupConst.TOTAL_SIZE, "0");

    } else if (!HiveMetaHook.ICEBERG.equals(getStatsSource()) && !quickStats) {
      stats = partish.getPartParameters();

    } else {
      Map<String, String> summary = getPartishSummary(partish, table, snapshot);
      if (summary != null) {
        if (summary.containsKey(TOTAL_DATA_FILES_PROP)) {
          stats.put(StatsSetupConst.NUM_FILES, summary.get(TOTAL_DATA_FILES_PROP));
        }
        if (summary.containsKey(TOTAL_RECORDS_PROP) && !quickStats) {
          long totalRecords = Long.parseLong(summary.get(TOTAL_RECORDS_PROP));
          if (summary.containsKey(TOTAL_EQ_DELETES_PROP) &&
              summary.containsKey(TOTAL_POS_DELETES_PROP)) {

            long totalEqDeletes = Long.parseLong(summary.get(TOTAL_EQ_DELETES_PROP));
            long totalPosDeletes = Long.parseLong(summary.get(TOTAL_POS_DELETES_PROP));

            long actualRecords = totalRecords - (totalEqDeletes > 0 ? 0 : totalPosDeletes);
            totalRecords = actualRecords > 0 ? actualRecords : totalRecords;
            // actualRecords maybe -ve in edge cases
          }
          stats.put(StatsSetupConst.ROW_COUNT, String.valueOf(totalRecords));
        }
        if (summary.containsKey(TOTAL_FILE_SIZE_PROP)) {
          stats.put(StatsSetupConst.TOTAL_SIZE, summary.get(TOTAL_FILE_SIZE_PROP));
        }
      }
    }
    return stats;
  }
@param jobConf Job configuration for InputFormat to access
@param deserializer Deserializer
@param exprNodeDesc Filter expression extracted by Hive
@return Entire filter to take advantage of Hive's pruning as well as Iceberg's pruning.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java