use of io.prestosql.spi.block.ShortArrayBlock in project hetu-core by openlookeng.
the class AbstractTestHBaseRowSerializer method testArray.
/**
* testArray
*
* @throws UnsupportedOperationException Exception
*/
@Test
public void testArray() {
short[] values = { 1, 2, 3 };
try {
Text text = new Text();
text.set(this.serializer.setObjectBytes(new ArrayType(VARCHAR), new ShortArrayBlock(0, Optional.empty(), values)));
this.serializer.getArray("array", new ArrayType(VARCHAR));
throw new UnsupportedOperationException("testArray : failed");
} catch (UnsupportedOperationException e) {
assertEquals(e.toString(), "java.lang.UnsupportedOperationException: Unsupported type array(varchar)");
}
}
use of io.prestosql.spi.block.ShortArrayBlock in project hetu-core by openlookeng.
the class TestShortArrayBlock method testCompactBlock.
@Test
public void testCompactBlock() {
short[] shortArray = { (short) 0, (short) 0, (short) 1, (short) 2, (short) 3, (short) 4 };
boolean[] valueIsNull = { false, true, false, false, false, false };
testCompactBlock(new ShortArrayBlock(0, Optional.empty(), new short[0]));
testCompactBlock(new ShortArrayBlock(shortArray.length, Optional.of(valueIsNull), shortArray));
testIncompactBlock(new ShortArrayBlock(shortArray.length - 1, Optional.of(valueIsNull), shortArray));
}
Aggregations