@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_isTblLevel = true; list.add(present_isTblLevel); if (present_isTblLevel) list.add(isTblLevel); boolean present_dbName = true && (isSetDbName()); list.add(present_dbName); if (present_dbName) list.add(dbName); boolean present_tableName = true && (isSetTableName()); list.add(present_tableName); if (present_tableName) list.add(tableName); boolean present_partName = true && (isSetPartName()); list.add(present_partName); if (present_partName) list.add(partName); boolean present_lastAnalyzed = true && (isSetLastAnalyzed()); list.add(present_lastAnalyzed); if (present_lastAnalyzed) list.add(lastAnalyzed); boolean present_catName = true && (isSetCatName()); list.add(present_catName); if (present_catName) list.add(catName); return list.hashCode(); }
first = false; if (isSetCatName()) { if (!first) sb.append(", "); sb.append("catName:");
if (struct.isSetCatName()) { oprot.writeFieldBegin(CAT_NAME_FIELD_DESC); oprot.writeString(struct.catName);
/** 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 IS_TBL_LEVEL: return isSetIsTblLevel(); case DB_NAME: return isSetDbName(); case TABLE_NAME: return isSetTableName(); case PART_NAME: return isSetPartName(); case LAST_ANALYZED: return isSetLastAnalyzed(); case CAT_NAME: return isSetCatName(); } throw new IllegalStateException(); }
lastComparison = Boolean.valueOf(isSetCatName()).compareTo(other.isSetCatName()); if (lastComparison != 0) { return lastComparison; if (isSetCatName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catName, other.catName); if (lastComparison != 0) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ColumnStatisticsDesc struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBool(struct.isTblLevel); oprot.writeString(struct.dbName); oprot.writeString(struct.tableName); BitSet optionals = new BitSet(); if (struct.isSetPartName()) { optionals.set(0); } if (struct.isSetLastAnalyzed()) { optionals.set(1); } if (struct.isSetCatName()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetPartName()) { oprot.writeString(struct.partName); } if (struct.isSetLastAnalyzed()) { oprot.writeI64(struct.lastAnalyzed); } if (struct.isSetCatName()) { oprot.writeString(struct.catName); } }
boolean this_present_catName = true && this.isSetCatName(); boolean that_present_catName = true && that.isSetCatName(); if (this_present_catName || that_present_catName) { if (!(this_present_catName && that_present_catName))
@Override public boolean setPartitionColumnStatistics(SetPartitionsStatsRequest request) throws TException { String defaultCat = getDefaultCatalog(conf); for (ColumnStatistics stats : request.getColStats()) { if (!stats.getStatsDesc().isSetCatName()) { stats.getStatsDesc().setCatName(defaultCat); } } return client.set_aggr_stats_for(request); }
private void normalizeColStatsInput(ColumnStatistics colStats) throws MetaException { // TODO: is this really needed? this code is propagated from HIVE-1362 but most of it is useless. ColumnStatisticsDesc statsDesc = colStats.getStatsDesc(); statsDesc.setCatName(statsDesc.isSetCatName() ? statsDesc.getCatName().toLowerCase() : getDefaultCatalog(conf)); statsDesc.setDbName(statsDesc.getDbName().toLowerCase()); statsDesc.setTableName(statsDesc.getTableName().toLowerCase()); statsDesc.setPartName(lowerCaseConvertPartName(statsDesc.getPartName())); long time = System.currentTimeMillis() / 1000; statsDesc.setLastAnalyzed(time); for (ColumnStatisticsObj statsObj : colStats.getStatsObj()) { statsObj.setColName(statsObj.getColName().toLowerCase()); statsObj.setColType(statsObj.getColType().toLowerCase()); } colStats.setStatsDesc(statsDesc); colStats.setStatsObj(colStats.getStatsObj()); }
/** * Performs a deep copy on <i>other</i>. */ public ColumnStatisticsDesc(ColumnStatisticsDesc other) { __isset_bitfield = other.__isset_bitfield; this.isTblLevel = other.isTblLevel; if (other.isSetDbName()) { this.dbName = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(other.dbName); } if (other.isSetTableName()) { this.tableName = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(other.tableName); } if (other.isSetPartName()) { this.partName = other.partName; } this.lastAnalyzed = other.lastAnalyzed; if (other.isSetCatName()) { this.catName = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(other.catName); } }
@Override public boolean updatePartitionColumnStatistics(ColumnStatistics statsObj) throws TException { if (!statsObj.getStatsDesc().isSetCatName()) { statsObj.getStatsDesc().setCatName(getDefaultCatalog(conf)); } // Note: currently this method doesn't set txn properties and thus won't work on txn tables. SetPartitionsStatsRequest req = new SetPartitionsStatsRequest(); req.addToColStats(statsObj); req.setNeedMerge(false); return client.update_partition_column_statistics_req(req).isResult(); }
/** {@inheritDoc} */ @Override public boolean updateTableColumnStatistics(ColumnStatistics statsObj) throws TException { if (!statsObj.getStatsDesc().isSetCatName()) { statsObj.getStatsDesc().setCatName(getDefaultCatalog(conf)); } // Note: currently this method doesn't set txn properties and thus won't work on txn tables. SetPartitionsStatsRequest req = new SetPartitionsStatsRequest(); req.addToColStats(statsObj); req.setNeedMerge(false); return client.update_table_column_statistics_req(req).isResult(); }
String catName = statsDesc.isSetCatName() ? statsDesc.getCatName() : getDefaultCatalog(conf); String dbName = statsDesc.getDbName(); String tableName = statsDesc.getTableName();
String catName = statsDesc.isSetCatName() ? statsDesc.getCatName() : getDefaultCatalog(conf); Table table = ensureGetTable(catName, statsDesc.getDbName(), statsDesc.getTableName()); List<String> colNames = new ArrayList<>();
List<ColumnStatisticsObj> statsObjs = colStats.getStatsObj(); ColumnStatisticsDesc statsDesc = colStats.getStatsDesc(); String catName = statsDesc.isSetCatName() ? statsDesc.getCatName() : getDefaultCatalog(conf); Table table = ensureGetTable(catName, statsDesc.getDbName(), statsDesc.getTableName()); Partition partition = convertToPart(getMPartition(
@Override public Map<String, String> updatePartitionColumnStatistics(ColumnStatistics colStats, List<String> partVals, String validWriteIds, long writeId) throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException { Map<String, String> newParams = rawStore.updatePartitionColumnStatistics( colStats, partVals, validWriteIds, writeId); // in case of event based cache update, cache is updated during commit txn if (newParams != null && !canUseEvents) { String catName = colStats.getStatsDesc().isSetCatName() ? normalizeIdentifier(colStats.getStatsDesc().getCatName()) : DEFAULT_CATALOG_NAME; String dbName = normalizeIdentifier(colStats.getStatsDesc().getDbName()); String tblName = normalizeIdentifier(colStats.getStatsDesc().getTableName()); if (!shouldCacheTable(catName, dbName, tblName)) { return newParams; } Partition part = getPartition(catName, dbName, tblName, partVals); part.setParameters(newParams); sharedCache.alterPartitionInCache(catName, dbName, tblName, partVals, part); sharedCache.updatePartitionColStatsInCache(catName, dbName, tblName, partVals, colStats.getStatsObj()); } return newParams; }
@Override public void onUpdateTableColumnStat(UpdateTableColumnStatEvent updateTableColumnStatEvent) throws MetaException { UpdateTableColumnStatMessage msg = MessageBuilder.getInstance() .buildUpdateTableColumnStatMessage(updateTableColumnStatEvent.getColStats(), updateTableColumnStatEvent.getTableObj(), updateTableColumnStatEvent.getTableParameters(), updateTableColumnStatEvent.getValidWriteIds(), updateTableColumnStatEvent.getWriteId()); NotificationEvent event = new NotificationEvent(0, now(), EventType.UPDATE_TABLE_COLUMN_STAT.toString(), msgEncoder.getSerializer().serialize(msg)); ColumnStatisticsDesc statDesc = updateTableColumnStatEvent.getColStats().getStatsDesc(); event.setCatName(statDesc.isSetCatName() ? statDesc.getCatName() : DEFAULT_CATALOG_NAME); event.setDbName(statDesc.getDbName()); event.setTableName(statDesc.getTableName()); process(event, updateTableColumnStatEvent); }
@Override public void onUpdatePartitionColumnStat(UpdatePartitionColumnStatEvent updatePartColStatEvent) throws MetaException { UpdatePartitionColumnStatMessage msg = MessageBuilder.getInstance() .buildUpdatePartitionColumnStatMessage(updatePartColStatEvent.getPartColStats(), updatePartColStatEvent.getPartVals(), updatePartColStatEvent.getPartParameters(), updatePartColStatEvent.getTableObj(), updatePartColStatEvent.getValidWriteIds(), updatePartColStatEvent.getWriteId()); NotificationEvent event = new NotificationEvent(0, now(), EventType.UPDATE_PARTITION_COLUMN_STAT.toString(), msgEncoder.getSerializer().serialize(msg)); ColumnStatisticsDesc statDesc = updatePartColStatEvent.getPartColStats().getStatsDesc(); event.setCatName(statDesc.isSetCatName() ? statDesc.getCatName() : DEFAULT_CATALOG_NAME); event.setDbName(statDesc.getDbName()); event.setTableName(statDesc.getTableName()); process(event, updatePartColStatEvent); }
private static void updateTableColumnsStatsInternal(Configuration conf, ColumnStatistics colStats, Map<String, String> newParams, String validWriteIds, long writeId) throws MetaException { String catName = colStats.getStatsDesc().isSetCatName() ? normalizeIdentifier(colStats.getStatsDesc().getCatName()) : getDefaultCatalog(conf);
mColStats.setCatName(statsDesc.isSetCatName() ? statsDesc.getCatName() : DEFAULT_CATALOG_NAME); mColStats.setDbName(statsDesc.getDbName()); mColStats.setTableName(statsDesc.getTableName());