public static long computeNDVGroupingColumns(List<ColStatistics> colStats, Statistics parentStats,
      boolean expDecay) {
    List<Long> ndvValues =
        extractNDVGroupingColumns(colStats, parentStats);
    if (ndvValues == null) {
      return 0L;
    }
    if (ndvValues.isEmpty()) {
      // No grouping columns, one row
      return 1L;
    }
    if (expDecay) {
      return addWithExpDecay(ndvValues);
    } else {
      return ndvValues.stream().reduce(1L, StatsUtils::safeMult);
    }
  }
Update the basic statistics of the statistics object based on the row number
@param stats
         - statistics to be updated
@param newNumRows
         - new number of rows
@param useColStats
         - use column statistics to compute data size
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java