public ColumnStatisticsDesc deepCopy() { return new ColumnStatisticsDesc(this); }
@Override public void setTableColumnStatistics(String databaseName, String tableName, List<ColumnStatisticsObj> statistics) throws TException { ColumnStatisticsDesc statisticsDescription = new ColumnStatisticsDesc(true, databaseName, tableName); ColumnStatistics request = new ColumnStatistics(statisticsDescription, statistics); client.update_table_column_statistics(request); }
@Override public void setPartitionColumnStatistics(String databaseName, String tableName, String partitionName, List<ColumnStatisticsObj> statistics) throws TException { ColumnStatisticsDesc statisticsDescription = new ColumnStatisticsDesc(false, databaseName, tableName); statisticsDescription.setPartName(partitionName); ColumnStatistics request = new ColumnStatistics(statisticsDescription, statistics); client.update_partition_column_statistics(request); }
/** * Performs a deep copy on <i>other</i>. */ public ColumnStatistics(ColumnStatistics other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetStatsDesc()) { this.statsDesc = new ColumnStatisticsDesc(other.statsDesc); } if (other.isSetStatsObj()) { List<ColumnStatisticsObj> __this__statsObj = new ArrayList<ColumnStatisticsObj>(other.statsObj.size()); for (ColumnStatisticsObj other_element : other.statsObj) { __this__statsObj.add(new ColumnStatisticsObj(other_element)); } this.statsObj = __this__statsObj; } this.isStatsCompliant = other.isStatsCompliant; }
continue; } else if (from != i) { ColumnStatisticsDesc csd = new ColumnStatisticsDesc(false, dbName, tableName); csd.setCatName(catName); csd.setPartName(lastPartName);
return null; ColumnStatisticsDesc csd = new ColumnStatisticsDesc(true, dbName, tableName); csd.setCatName(catName); ColumnStatistics result = makeColumnStats(list, csd, 0);
private ColumnStatistics buildStatsForOneTableOrPartition(String catName, String dbName, String tableName, String partName, Collection<Column> cols) { ColumnStatisticsDesc desc = new ColumnStatisticsDesc(partName == null, dbName, tableName); if (!NO_CAT.equals(catName)) desc.setCatName(catName); if (partName != null) desc.setPartName(partName); List<ColumnStatisticsObj> objs = new ArrayList<>(cols.size()); for (Column col : cols) objs.add(col.generate()); return new ColumnStatistics(desc, objs); }
case 1: // STATS_DESC if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.statsDesc = new ColumnStatisticsDesc(); struct.statsDesc.read(iprot); struct.setStatsDescIsSet(true);
private ColumnStatisticsDesc getColumnStatsDesc(String dbName, String tableName, String partName, boolean isTblLevel) { ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(); statsDesc.setDbName(dbName); statsDesc.setTableName(tableName); statsDesc.setIsTblLevel(isTblLevel); if (!isTblLevel) { statsDesc.setPartName(partName); } else { statsDesc.setPartName(null); } return statsDesc; }
private ColumnStatisticsDesc getColumnStatsDesc(String dbName, String tableName, String partName, boolean isTblLevel) { ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(); statsDesc.setDbName(dbName); statsDesc.setTableName(tableName); statsDesc.setIsTblLevel(isTblLevel); if (!isTblLevel) { statsDesc.setPartName(partName); } else { statsDesc.setPartName(null); } return statsDesc; }
private ColumnStatisticsDesc getColumnStatsDesc(String dbName, String tableName, String partName, boolean isTblLevel) { ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(); statsDesc.setDbName(dbName); statsDesc.setTableName(tableName); statsDesc.setIsTblLevel(isTblLevel); if (!isTblLevel) { statsDesc.setPartName(partName); } else { statsDesc.setPartName(null); } return statsDesc; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ColumnStatistics struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.statsDesc = new ColumnStatisticsDesc(); struct.statsDesc.read(iprot); struct.setStatsDescIsSet(true); { org.apache.thrift.protocol.TList _list281 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.statsObj = new ArrayList<ColumnStatisticsObj>(_list281.size); ColumnStatisticsObj _elem282; for (int _i283 = 0; _i283 < _list281.size; ++_i283) { _elem282 = new ColumnStatisticsObj(); _elem282.read(iprot); struct.statsObj.add(_elem282); } } struct.setStatsObjIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.isStatsCompliant = iprot.readBool(); struct.setIsStatsCompliantIsSet(true); } } }
private ColumnStatisticsDesc buildColumnStatsDesc(Table table, String partName, boolean isTblLevel) { String dbName = table.getDbName(); assert dbName != null; ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(); statsDesc.setDbName(dbName); statsDesc.setTableName(table.getTableName()); statsDesc.setIsTblLevel(isTblLevel); if (!isTblLevel) { statsDesc.setPartName(partName); } else { statsDesc.setPartName(null); } return statsDesc; }
public static ColumnStatisticsDesc getTableColumnStatisticsDesc( MTableColumnStatistics mStatsObj) { ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(); statsDesc.setIsTblLevel(true); statsDesc.setCatName(mStatsObj.getCatName()); statsDesc.setDbName(mStatsObj.getDbName()); statsDesc.setTableName(mStatsObj.getTableName()); statsDesc.setLastAnalyzed(mStatsObj.getLastAnalyzed()); return statsDesc; }
public static ColumnStatisticsDesc getPartitionColumnStatisticsDesc( MPartitionColumnStatistics mStatsObj) { ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(); statsDesc.setIsTblLevel(false); statsDesc.setCatName(mStatsObj.getCatName()); statsDesc.setDbName(mStatsObj.getDbName()); statsDesc.setTableName(mStatsObj.getTableName()); statsDesc.setPartName(mStatsObj.getPartitionName()); statsDesc.setLastAnalyzed(mStatsObj.getLastAnalyzed()); return statsDesc; }
@Override public ColumnStatistics getTableColumnStatistics( String catName, String dbName, String tblName, List<String> colNames, String validWriteIds) throws MetaException, NoSuchObjectException { catName = StringUtils.normalizeIdentifier(catName); dbName = StringUtils.normalizeIdentifier(dbName); tblName = StringUtils.normalizeIdentifier(tblName); if (!shouldCacheTable(catName, dbName, tblName)) { return rawStore.getTableColumnStatistics( catName, dbName, tblName, colNames, validWriteIds); } Table table = sharedCache.getTableFromCache(catName, dbName, tblName); if (table == null) { // The table is not yet loaded in cache return rawStore.getTableColumnStatistics( catName, dbName, tblName, colNames, validWriteIds); } ColumnStatisticsDesc csd = new ColumnStatisticsDesc(true, dbName, tblName); List<ColumnStatisticsObj> colStatObjs = sharedCache.getTableColStatsFromCache(catName, dbName, tblName, colNames); return adjustColStatForGet(table.getParameters(), table.getParameters(), new ColumnStatistics(csd, colStatObjs), table.getWriteId(), validWriteIds); }
ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(true, dbName, tblName); statsDesc.setPartName("col"); List<ColumnStatisticsObj> colStatObjs = new ArrayList<>();
ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(true, dbName, tblName); statsDesc.setPartName("col"); List<ColumnStatisticsObj> colStatObjs = new ArrayList<>();
ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(true, dbName, tblName); statsDesc.setPartName("col"); List<ColumnStatisticsObj> colStatObjs = new ArrayList<>();
ColumnStatisticsDesc colStatsDesc = new ColumnStatisticsDesc(colStats.getStatsDesc()); colStatsDesc.setTableName(tblDesc.getTableName()); colStatsDesc.setDbName(tblDesc.getDatabaseName());