private List<String> getExistingNonPartTableStatsToUpdate(TableName fullTableName,
      String cat, String db, String tbl, Map<String, String> params, long statsWriteId,
      List<String> allCols, String writeIdString) throws MetaException {
    ColumnStatistics existingStats = null;
    try {
      // Note: this should NOT do txn verification - we want to get outdated stats, to
      //       see if we need to update anything.
      existingStats = rs.getTableColumnStatistics(cat, db, tbl, allCols, Constants.HIVE_ENGINE);
    } catch (NoSuchObjectException e) {
      LOG.error("Cannot retrieve existing stats, skipping " + fullTableName, e);
      return null;
    }
    // TODO: we should probably skip updating if writeId is from an active txn
    boolean isTxnValid = (writeIdString == null) || ObjectStore.isCurrentStatsValidForTheQuery(
        params, statsWriteId, writeIdString, false);
    return getExistingStatsToUpdate(existingStats, params, isTxnValid);
  }
Whether to only update stats that already exist and are out of date.
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUpdaterThread.java