private ColumnStatistics adjustColStatForGet(Map<String, String> tableParams, Map<String, String> params, ColumnStatistics colStat, long statsWriteId, String validWriteIds) throws MetaException { colStat.setIsStatsCompliant(true); if (!TxnUtils.isTransactionalTable(tableParams)) return colStat; // Not a txn table. if (areTxnStatsSupported && ((validWriteIds == null) || ObjectStore.isCurrentStatsValidForTheQuery( conf, params, statsWriteId, validWriteIds, false))) { // Valid stats are supported for txn tables, and either no verification was requested by the // caller, or the verification has succeeded. return colStat; } // Don't clone; ColStats objects are not cached, only their parts. colStat.setIsStatsCompliant(false); return colStat; }
if (!areTxnStatsSupported) { for (ColumnStatistics cs : allStats) { cs.setIsStatsCompliant(false); mpart.getPartitionName(), mpart.getWriteId(), writeIdList); cs.setIsStatsCompliant(false); } else { cs.setIsStatsCompliant(true);
public void setFieldValue(_Fields field, Object value) { switch (field) { case STATS_DESC: if (value == null) { unsetStatsDesc(); } else { setStatsDesc((ColumnStatisticsDesc)value); } break; case STATS_OBJ: if (value == null) { unsetStatsObj(); } else { setStatsObj((List<ColumnStatisticsObj>)value); } break; case IS_STATS_COMPLIANT: if (value == null) { unsetIsStatsCompliant(); } else { setIsStatsCompliant((Boolean)value); } break; } }
@Override public ColumnStatistics getTableColumnStatistics( String catName, String dbName, String tableName, List<String> colNames, String writeIdList) throws MetaException, NoSuchObjectException { // If the current stats in the metastore doesn't comply with // the isolation level of the query, set No to the compliance flag. Boolean isCompliant = null; if (writeIdList != null) { MTable table = this.getMTable(catName, dbName, tableName); isCompliant = !TxnUtils.isTransactionalTable(table.getParameters()) || (areTxnStatsSupported && isCurrentStatsValidForTheQuery(table, writeIdList, false)); } ColumnStatistics stats = getTableColumnStatisticsInternal( catName, dbName, tableName, colNames, true, true); if (stats != null && isCompliant != null) { stats.setIsStatsCompliant(isCompliant); } return stats; }