Search in sources :

Example 1 with InMemoryRecordSet

use of com.facebook.presto.spi.InMemoryRecordSet in project presto by prestodb.

the class TestFieldSetFilteringRecordSet method test.

@Test
public void test() {
    ArrayType arrayOfBigintType = new ArrayType(BIGINT);
    FieldSetFilteringRecordSet fieldSetFilteringRecordSet = new FieldSetFilteringRecordSet(FUNCTION_REGISTRY, new InMemoryRecordSet(ImmutableList.of(BIGINT, BIGINT, TIMESTAMP_WITH_TIME_ZONE, TIMESTAMP_WITH_TIME_ZONE, arrayOfBigintType, arrayOfBigintType), ImmutableList.of(ImmutableList.of(100L, 100L, // test same time in different time zone to make sure equal check was done properly
    packDateTimeWithZone(100, getTimeZoneKeyForOffset(123)), packDateTimeWithZone(100, getTimeZoneKeyForOffset(234)), // test structural type
    arrayBlockOf(BIGINT, 12, 34, 56), arrayBlockOf(BIGINT, 12, 34, 56)))), ImmutableList.of(ImmutableSet.of(0, 1), ImmutableSet.of(2, 3), ImmutableSet.of(4, 5)));
    RecordCursor recordCursor = fieldSetFilteringRecordSet.cursor();
    assertTrue(recordCursor.advanceNextPosition());
}
Also used : ArrayType(com.facebook.presto.type.ArrayType) RecordCursor(com.facebook.presto.spi.RecordCursor) InMemoryRecordSet(com.facebook.presto.spi.InMemoryRecordSet) Test(org.testng.annotations.Test)

Aggregations

InMemoryRecordSet (com.facebook.presto.spi.InMemoryRecordSet)1 RecordCursor (com.facebook.presto.spi.RecordCursor)1 ArrayType (com.facebook.presto.type.ArrayType)1 Test (org.testng.annotations.Test)1