public PartitionsStatsRequest deepCopy() { return new PartitionsStatsRequest(this); }
public Object getFieldValue(_Fields field) { switch (field) { case DB_NAME: return getDbName(); case TBL_NAME: return getTblName(); case COL_NAMES: return getColNames(); case PART_NAMES: return getPartNames(); case CAT_NAME: return getCatName(); case VALID_WRITE_ID_LIST: return getValidWriteIdList(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PartitionsStatsRequest) return this.equals((PartitionsStatsRequest)that); return false; }
/** 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 DB_NAME: return isSetDbName(); case TBL_NAME: return isSetTblName(); case COL_NAMES: return isSetColNames(); case PART_NAMES: return isSetPartNames(); case CAT_NAME: return isSetCatName(); case VALID_WRITE_ID_LIST: return isSetValidWriteIdList(); } throw new IllegalStateException(); }
@Override public Map<String, List<ColumnStatisticsObj>> getPartitionColumnStatistics( String catName, String dbName, String tableName, List<String> partNames, List<String> colNames, String validWriteIdList) throws NoSuchObjectException, MetaException, TException { PartitionsStatsRequest rqst = new PartitionsStatsRequest(dbName, tableName, colNames, partNames == null ? new ArrayList<String>() : partNames); rqst.setCatName(catName); rqst.setValidWriteIdList(validWriteIdList); return client.get_partitions_statistics_req(rqst).getPartStats(); }
@Override public Map<String, List<ColumnStatisticsObj>> getPartitionColumnStatistics( String catName, String dbName, String tableName, List<String> partNames, List<String> colNames) throws TException { PartitionsStatsRequest rqst = new PartitionsStatsRequest(dbName, tableName, colNames, partNames); rqst.setCatName(catName); return client.get_partitions_statistics_req(rqst).getPartStats(); }
@Override public Map<String, List<ColumnStatisticsObj>> getPartitionColumnStatistics( String dbName, String tableName, List<String> partNames, List<String> colNames, String validWriteIdList) throws NoSuchObjectException, MetaException, TException { PartitionsStatsRequest psr = new PartitionsStatsRequest(dbName, tableName, colNames, partNames); psr.setValidWriteIdList(validWriteIdList); return client.get_partitions_statistics_req( psr).getPartStats(); }
/** * Performs a deep copy on <i>other</i>. */ public PartitionsStatsRequest(PartitionsStatsRequest other) { if (other.isSetDbName()) { this.dbName = other.dbName; } if (other.isSetTblName()) { this.tblName = other.tblName; } if (other.isSetColNames()) { List<String> __this__colNames = new ArrayList<String>(other.colNames); this.colNames = __this__colNames; } if (other.isSetPartNames()) { List<String> __this__partNames = new ArrayList<String>(other.partNames); this.partNames = __this__partNames; } if (other.isSetCatName()) { this.catName = other.catName; } if (other.isSetValidWriteIdList()) { this.validWriteIdList = other.validWriteIdList; } }
@Override public AggrStats getAggrColStatsFor(String catName, String dbName, String tblName, List<String> colNames, List<String> partNames, String writeIdList) throws NoSuchObjectException, MetaException, TException { if (colNames.isEmpty() || partNames.isEmpty()) { LOG.debug("Columns is empty or partNames is empty : Short-circuiting stats eval on client side."); return new AggrStats(new ArrayList<>(),0); // Nothing to aggregate } PartitionsStatsRequest req = new PartitionsStatsRequest(dbName, tblName, colNames, partNames); req.setCatName(catName); req.setValidWriteIdList(writeIdList); return client.get_aggr_stats_for(req); }
@Override public AggrStats getAggrColStatsFor(String catName, String dbName, String tblName, List<String> colNames, List<String> partNames) throws TException { if (colNames.isEmpty() || partNames.isEmpty()) { LOG.debug("Columns is empty or partNames is empty : Short-circuiting stats eval on client side."); return new AggrStats(new ArrayList<>(),0); // Nothing to aggregate } PartitionsStatsRequest req = new PartitionsStatsRequest(dbName, tblName, colNames, partNames); req.setCatName(catName); return client.get_aggr_stats_for(req); }
@Override public AggrStats getAggrColStatsFor( String dbName, String tblName, List<String> colNames, List<String> partName, String writeIdList) throws NoSuchObjectException, MetaException, TException { if (colNames.isEmpty() || partName.isEmpty()) { LOG.debug("Columns is empty or partNames is empty : Short-circuiting stats eval on client side."); return new AggrStats(new ArrayList<>(),0); // Nothing to aggregate } PartitionsStatsRequest req = new PartitionsStatsRequest(dbName, tblName, colNames, partName); req.setValidWriteIdList(writeIdList); return client.get_aggr_stats_for(req); }
@Override public AggrStats get_aggr_stats_for(PartitionsStatsRequest request) throws TException { String catName = request.isSetCatName() ? request.getCatName().toLowerCase() : getDefaultCatalog(conf); String dbName = request.getDbName().toLowerCase(); String tblName = request.getTblName().toLowerCase(); startFunction("get_aggr_stats_for", ": table=" + TableName.getQualified(catName, dbName, tblName)); List<String> lowerCaseColNames = new ArrayList<>(request.getColNames().size()); for (String colName : request.getColNames()) { lowerCaseColNames.add(colName.toLowerCase()); } List<String> lowerCasePartNames = new ArrayList<>(request.getPartNames().size()); for (String partName : request.getPartNames()) { lowerCasePartNames.add(lowerCaseConvertPartName(partName)); } AggrStats aggrStats = null; try { aggrStats = getMS().get_aggr_stats_for(catName, dbName, tblName, lowerCasePartNames, lowerCaseColNames, request.getValidWriteIdList()); return aggrStats; } finally { endFunction("get_aggr_stats_for", aggrStats == null, null, request.getTblName()); } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetDbName()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'dbName' is unset! Struct:" + toString()); } if (!isSetTblName()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'tblName' is unset! Struct:" + toString()); } if (!isSetColNames()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'colNames' is unset! Struct:" + toString()); } if (!isSetPartNames()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'partNames' is unset! Struct:" + toString()); } // check for sub-struct validity }
@Override public Map<String, List<ColumnStatisticsObj>> getPartitionColumnStatistics(String databaseName, String tableName, List<String> partitionNames, List<String> columnNames) throws TException { PartitionsStatsRequest partitionsStatsRequest = new PartitionsStatsRequest(databaseName, tableName, columnNames, partitionNames); return client.get_partitions_statistics_req(partitionsStatsRequest).getPartStats(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PartitionsStatsRequest) return this.equals((PartitionsStatsRequest)that); return false; }
@Override public PartitionsStatsResult get_partitions_statistics_req(PartitionsStatsRequest request) throws TException { String catName = request.isSetCatName() ? request.getCatName().toLowerCase() : getDefaultCatalog(conf); String dbName = request.getDbName().toLowerCase(); String tblName = request.getTblName().toLowerCase(); startFunction("get_partitions_statistics_req", ": table=" + TableName.getQualified(catName, dbName, tblName)); List<String> lowerCaseColNames = new ArrayList<>(request.getColNames().size()); for (String colName : request.getColNames()) { lowerCaseColNames.add(colName.toLowerCase()); List<String> lowerCasePartNames = new ArrayList<>(request.getPartNames().size()); for (String partName : request.getPartNames()) { lowerCasePartNames.add(lowerCaseConvertPartName(partName)); List<ColumnStatistics> stats = getMS().getPartitionColumnStatistics( catName, dbName, tblName, lowerCasePartNames, lowerCaseColNames, request.isSetValidWriteIdList() ? request.getValidWriteIdList() : null); Map<String, List<ColumnStatisticsObj>> map = new HashMap<>(); if (stats != null) {
boolean this_present_dbName = true && this.isSetDbName(); boolean that_present_dbName = true && that.isSetDbName(); if (this_present_dbName || that_present_dbName) { if (!(this_present_dbName && that_present_dbName)) boolean this_present_tblName = true && this.isSetTblName(); boolean that_present_tblName = true && that.isSetTblName(); if (this_present_tblName || that_present_tblName) { if (!(this_present_tblName && that_present_tblName)) boolean this_present_colNames = true && this.isSetColNames(); boolean that_present_colNames = true && that.isSetColNames(); if (this_present_colNames || that_present_colNames) { if (!(this_present_colNames && that_present_colNames)) boolean this_present_partNames = true && this.isSetPartNames(); boolean that_present_partNames = true && that.isSetPartNames(); if (this_present_partNames || that_present_partNames) { if (!(this_present_partNames && that_present_partNames)) 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)) boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); if (this_present_validWriteIdList || that_present_validWriteIdList) { if (!(this_present_validWriteIdList && that_present_validWriteIdList))
@Override public AggrStats getAggrColStatsFor(String dbName, String tblName, List<String> colNames, List<String> partNames) throws NoSuchObjectException, MetaException, TException { if (colNames.isEmpty() || partNames.isEmpty()) { LOG.debug("Columns is empty or partNames is empty : Short-circuiting stats eval on client side."); return new AggrStats(new ArrayList<>(),0); // Nothing to aggregate } PartitionsStatsRequest req = new PartitionsStatsRequest(dbName, tblName, colNames, partNames); return client.get_aggr_stats_for(req); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PartitionsStatsRequest) return this.equals((PartitionsStatsRequest)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case DB_NAME: return getDbName(); case TBL_NAME: return getTblName(); case COL_NAMES: return getColNames(); case PART_NAMES: return getPartNames(); } throw new IllegalStateException(); }