@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_statsDesc = true && (isSetStatsDesc()); list.add(present_statsDesc); if (present_statsDesc) list.add(statsDesc); boolean present_statsObj = true && (isSetStatsObj()); list.add(present_statsObj); if (present_statsObj) list.add(statsObj); boolean present_isStatsCompliant = true && (isSetIsStatsCompliant()); list.add(present_isStatsCompliant); if (present_isStatsCompliant) list.add(isStatsCompliant); return list.hashCode(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("ColumnStatistics("); boolean first = true; sb.append("statsDesc:"); if (this.statsDesc == null) { sb.append("null"); } else { sb.append(this.statsDesc); } first = false; if (!first) sb.append(", "); sb.append("statsObj:"); if (this.statsObj == null) { sb.append("null"); } else { sb.append(this.statsObj); } first = false; if (isSetIsStatsCompliant()) { if (!first) sb.append(", "); sb.append("isStatsCompliant:"); sb.append(this.isStatsCompliant); first = false; } sb.append(")"); return sb.toString(); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case STATS_DESC: return isSetStatsDesc(); case STATS_OBJ: return isSetStatsObj(); case IS_STATS_COMPLIANT: return isSetIsStatsCompliant(); } throw new IllegalStateException(); }
lastComparison = Boolean.valueOf(isSetIsStatsCompliant()).compareTo(other.isSetIsStatsCompliant()); if (lastComparison != 0) { return lastComparison; if (isSetIsStatsCompliant()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isStatsCompliant, other.isStatsCompliant); if (lastComparison != 0) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ColumnStatistics struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.statsDesc.write(oprot); { oprot.writeI32(struct.statsObj.size()); for (ColumnStatisticsObj _iter280 : struct.statsObj) { _iter280.write(oprot); } } BitSet optionals = new BitSet(); if (struct.isSetIsStatsCompliant()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetIsStatsCompliant()) { oprot.writeBool(struct.isStatsCompliant); } }
public boolean equals(ColumnStatistics that) { if (that == null) return false; boolean this_present_statsDesc = true && this.isSetStatsDesc(); boolean that_present_statsDesc = true && that.isSetStatsDesc(); if (this_present_statsDesc || that_present_statsDesc) { if (!(this_present_statsDesc && that_present_statsDesc)) return false; if (!this.statsDesc.equals(that.statsDesc)) return false; } boolean this_present_statsObj = true && this.isSetStatsObj(); boolean that_present_statsObj = true && that.isSetStatsObj(); if (this_present_statsObj || that_present_statsObj) { if (!(this_present_statsObj && that_present_statsObj)) return false; if (!this.statsObj.equals(that.statsObj)) return false; } boolean this_present_isStatsCompliant = true && this.isSetIsStatsCompliant(); boolean that_present_isStatsCompliant = true && that.isSetIsStatsCompliant(); if (this_present_isStatsCompliant || that_present_isStatsCompliant) { if (!(this_present_isStatsCompliant && that_present_isStatsCompliant)) return false; if (this.isStatsCompliant != that.isStatsCompliant) return false; } return true; }
public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnStatistics struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.statsDesc != null) { oprot.writeFieldBegin(STATS_DESC_FIELD_DESC); struct.statsDesc.write(oprot); oprot.writeFieldEnd(); } if (struct.statsObj != null) { oprot.writeFieldBegin(STATS_OBJ_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.statsObj.size())); for (ColumnStatisticsObj _iter279 : struct.statsObj) { _iter279.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.isSetIsStatsCompliant()) { oprot.writeFieldBegin(IS_STATS_COMPLIANT_FIELD_DESC); oprot.writeBool(struct.isStatsCompliant); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@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) {