private static void estimateStatsForMissingCols(List<String> neededColumns, List<ColStatistics> columnStats,
      HiveConf conf, long nr, List<ColumnInfo> schema) {

    Set<String> neededCols = new HashSet<>(neededColumns);
    Set<String> colsWithStats = new HashSet<>();

    for (ColStatistics cstats : columnStats) {
      colsWithStats.add(cstats.getColumnName());
    }

    List<String> missingColStats = new ArrayList<>(Sets.difference(neededCols, colsWithStats));

    if (!missingColStats.isEmpty()) {
      columnStats.addAll(
          estimateStats(schema, missingColStats, conf, nr));
    }
  }
Returns number of rows if it exists. Otherwise it estimates number of rows
based on estimated data size for both partition and non-partitioned table
RelOptHiveTable's getRowCount uses this.
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java