use of io.prestosql.plugin.thrift.api.PrestoThriftBlock in project hetu-core by openlookeng.
the class TestPrestoThriftBigint method testReadBlockWrongActualType.
@Test(expectedExceptions = IllegalArgumentException.class)
public void testReadBlockWrongActualType() {
PrestoThriftBlock columnsData = integerData(new PrestoThriftInteger(null, null));
columnsData.toBlock(BIGINT);
}
use of io.prestosql.plugin.thrift.api.PrestoThriftBlock in project hetu-core by openlookeng.
the class TestPrestoThriftBigint method testWriteBlockEmpty.
@Test
public void testWriteBlockEmpty() {
PrestoThriftBlock column = fromBlock(longBlock());
assertNotNull(column.getBigintData());
assertNull(column.getBigintData().getNulls());
assertNull(column.getBigintData().getLongs());
}
use of io.prestosql.plugin.thrift.api.PrestoThriftBlock in project hetu-core by openlookeng.
the class TestPrestoThriftBigint method testWriteBlockAllNulls.
@Test
public void testWriteBlockAllNulls() {
Block source = longBlock(null, null, null, null, null);
PrestoThriftBlock column = fromBlock(source);
assertNotNull(column.getBigintData());
assertEquals(column.getBigintData().getNulls(), new boolean[] { true, true, true, true, true });
assertNull(column.getBigintData().getLongs());
}
use of io.prestosql.plugin.thrift.api.PrestoThriftBlock in project hetu-core by openlookeng.
the class TestPrestoThriftBigint method testWriteBlockAllNonNull.
@Test
public void testWriteBlockAllNonNull() {
Block source = longBlock(1, 2, 3, 4, 5);
PrestoThriftBlock column = fromBlock(source);
assertNotNull(column.getBigintData());
assertNull(column.getBigintData().getNulls());
assertEquals(column.getBigintData().getLongs(), new long[] { 1, 2, 3, 4, 5 });
}
use of io.prestosql.plugin.thrift.api.PrestoThriftBlock in project hetu-core by openlookeng.
the class TestPrestoThriftBigint method testReadBlockAllNullsOption2.
@Test
public void testReadBlockAllNullsOption2() {
PrestoThriftBlock columnsData = longColumn(new boolean[] { true, true, true, true, true, true, true }, new long[] { 0, 0, 0, 0, 0, 0, 0 });
Block actual = columnsData.toBlock(BIGINT);
assertBlockEquals(actual, list(null, null, null, null, null, null, null));
}
Aggregations