public Object getFieldValue(_Fields field) { switch (field) { case STATS_DESC: return getStatsDesc(); case STATS_OBJ: return getStatsObj(); case IS_STATS_COMPLIANT: return isIsStatsCompliant(); } throw new IllegalStateException(); }
@Override public TableStatsResult get_table_statistics_req(TableStatsRequest request) throws TException { String catName = request.isSetCatName() ? request.getCatName().toLowerCase() : getDefaultCatalog(conf); String dbName = request.getDbName().toLowerCase(); String tblName = request.getTblName().toLowerCase(); startFunction("get_table_statistics_req", ": table=" + TableName.getQualified(catName, dbName, tblName)); TableStatsResult result = null; List<String> lowerCaseColNames = new ArrayList<>(request.getColNames().size()); for (String colName : request.getColNames()) { lowerCaseColNames.add(colName.toLowerCase()); } try { ColumnStatistics cs = getMS().getTableColumnStatistics( catName, dbName, tblName, lowerCaseColNames, request.getValidWriteIdList()); // Note: stats compliance is not propagated to the client; instead, we just return nothing // if stats are not compliant for now. This won't work for stats merging, but that // is currently only done on metastore size (see set_aggr...). // For some optimizations we might make use of incorrect stats that are "better than // nothing", so this may change in future. result = new TableStatsResult((cs == null || cs.getStatsObj() == null || (cs.isSetIsStatsCompliant() && !cs.isIsStatsCompliant())) ? Lists.newArrayList() : cs.getStatsObj()); } finally { endFunction("get_table_statistics_req", result == null, null, tblName); } return result; }
if (stat.isSetIsStatsCompliant() && !stat.isIsStatsCompliant()) continue; map.put(stat.getStatsDesc().getPartName(), stat.getStatsObj());
ColumnStatistics csOld = oldStatsMap.get(entry.getKey()); boolean isInvalidTxnStats = csOld != null && csOld.isSetIsStatsCompliant() && !csOld.isIsStatsCompliant(); Partition part = mapToPart.get(entry.getKey()); if (isInvalidTxnStats) {
&& csOld.isSetIsStatsCompliant() && !csOld.isIsStatsCompliant(); if (isInvalidTxnStats) {