public BlockletMinMaxIndex deepCopy() { return new BlockletMinMaxIndex(this); }
/** * Performs a deep copy on <i>other</i>. */ public BlockletIndex(BlockletIndex other) { if (other.isSetMin_max_index()) { this.min_max_index = new BlockletMinMaxIndex(other.min_max_index); } if (other.isSetB_tree_index()) { this.b_tree_index = new BlockletBTreeIndex(other.b_tree_index); } }
case 1: // MIN_MAX_INDEX if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.min_max_index = new BlockletMinMaxIndex(); struct.min_max_index.read(iprot); struct.setMin_max_indexIsSet(true);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BlockletIndex struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.min_max_index = new BlockletMinMaxIndex(); struct.min_max_index.read(iprot); struct.setMin_max_indexIsSet(true); } if (incoming.get(1)) { struct.b_tree_index = new BlockletBTreeIndex(); struct.b_tree_index.read(iprot); struct.setB_tree_indexIsSet(true); } } }
/** * convert BlockletMinMaxIndex of carbon metadata to external thrift BlockletMinMaxIndex */ public static BlockletMinMaxIndex convertMinMaxIndex( org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex minMaxIndex) { if (minMaxIndex == null) { return null; } BlockletMinMaxIndex blockletMinMaxIndex = new BlockletMinMaxIndex(); for (int i = 0; i < minMaxIndex.getMaxValues().length; i++) { blockletMinMaxIndex.addToMax_values(ByteBuffer.wrap(minMaxIndex.getMaxValues()[i])); blockletMinMaxIndex.addToMin_values(ByteBuffer.wrap(minMaxIndex.getMinValues()[i])); blockletMinMaxIndex.addToMin_max_presence(minMaxIndex.getIsMinMaxSet()[i]); } return blockletMinMaxIndex; }
this.min_max = new BlockletMinMaxIndex(other.min_max);
case 10: // MIN_MAX if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.min_max = new BlockletMinMaxIndex(); struct.min_max.read(iprot); struct.setMin_maxIsSet(true);
struct.min_max = new BlockletMinMaxIndex(); struct.min_max.read(iprot); struct.setMin_maxIsSet(true);
private BlockletMinMaxIndex buildMinMaxIndex(ColumnPage inputPage, List<Encoding> encoders) { BlockletMinMaxIndex index = new BlockletMinMaxIndex(); ByteBuffer max; ByteBuffer min; if (CarbonUtil.isEncodedWithMeta(encoders) && inputPage.getColumnSpec().getColumnType() == ColumnType.PLAIN_VALUE) { max = ByteBuffer.wrap(DataTypeUtil .getMinMaxBytesBasedOnDataTypeForNoDictionaryColumn(inputPage.getStatistics().getMax(), inputPage.getDataType())); min = ByteBuffer.wrap(DataTypeUtil .getMinMaxBytesBasedOnDataTypeForNoDictionaryColumn(inputPage.getStatistics().getMin(), inputPage.getDataType())); } else { byte[] bytes = CarbonUtil.getValueAsBytes(inputPage.getDataType(), inputPage.getStatistics().getMax()); max = ByteBuffer.wrap(bytes); min = ByteBuffer.wrap( CarbonUtil.getValueAsBytes(inputPage.getDataType(), inputPage.getStatistics().getMin())); } index.addToMax_values(max); index.addToMin_values(min); index.addToMin_max_presence(inputPage.getStatistics().writeMinMax()); return index; }
public static BlockletIndex getBlockletIndex(EncodedBlocklet encodedBlocklet, List<CarbonMeasure> carbonMeasureList) { BlockletMinMaxIndex blockletMinMaxIndex = new BlockletMinMaxIndex();