use of org.apache.phoenix.schema.ColumnValueDecoder in project phoenix by apache.
the class SingleCellColumnExpression method evaluate.
@Override
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
if (!super.evaluate(tuple, ptr)) {
return false;
} else if (ptr.getLength() == 0) {
return true;
}
// the first position is reserved and we offset maxEncodedColumnQualifier by ENCODED_CQ_COUNTER_INITIAL_VALUE (which is the minimum encoded column qualifier)
int index = decodedColumnQualifier - QueryConstants.ENCODED_CQ_COUNTER_INITIAL_VALUE + 1;
byte serializedImmutableStorageScheme = ptr.get()[ptr.getOffset() + ptr.getLength() - Bytes.SIZEOF_BYTE];
ImmutableStorageScheme immutableStorageScheme = ImmutableStorageScheme.fromSerializedValue(serializedImmutableStorageScheme);
// Given a ptr to the entire array, set ptr to point to a particular element within that array
ColumnValueDecoder encoderDecoder = immutableStorageScheme.getDecoder();
return encoderDecoder.decode(ptr, index);
}
Aggregations