private static List<String> extractColumnStates(Table table, List<String> columns,
      ColumnStatsList colStatsCache, List<ColStatistics> columnStats) {
    if (colStatsCache == null) {
      return columns;
    }
    List<String> neededColsToRetrieve = new ArrayList<>(columns.size());
    for (String colName : columns) {
      ColStatistics colStats = colStatsCache.getColStats().get(colName);
      if (colStats == null) {
        neededColsToRetrieve.add(colName);
        LOG.debug("Stats for column {} in table {} could not be retrieved from cache", colName,
            table.getCompleteName());
      } else {
        columnStats.add(colStats);
        LOG.debug("Stats for column {} in table {} retrieved from cache", colName, table.getCompleteName());
      }
    }
    return neededColsToRetrieve;
  }
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