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