use of org.apache.phoenix.expression.function.SetBitFunction in project phoenix by apache.
the class GetSetByteBitFunctionTest method testSetBitExpression.
private void testSetBitExpression(Expression data, Expression offset, Expression newValue, byte[] expected) throws SQLException {
List<Expression> expressions = Lists.newArrayList(data, offset, newValue);
Expression setBitFunction = new SetBitFunction(expressions);
ImmutableBytesWritable ptr = new ImmutableBytesWritable();
setBitFunction.evaluate(null, ptr);
byte[] result = (byte[]) setBitFunction.getDataType().toObject(ptr, setBitFunction.getSortOrder());
assertArrayEquals(expected, result);
}
Aggregations