use of org.apache.hadoop.hive.ql.io.orc.OrcRawRecordMerger.ReaderKey in project hive by apache.
the class TestOrcRawRecordMerger method testReaderPair.
@Test
public void testReaderPair() throws Exception {
ReaderKey key = new ReaderKey();
Reader reader = createMockReader();
RecordIdentifier minKey = new RecordIdentifier(10, 20, 30);
RecordIdentifier maxKey = new RecordIdentifier(40, 50, 60);
ReaderPair pair = new OrcRawRecordMerger.ReaderPairAcid(key, reader, minKey, maxKey, new Reader.Options(), new HiveConf());
RecordReader recordReader = pair.getRecordReader();
assertEquals(10, key.getWriteId());
assertEquals(20, key.getBucketProperty());
assertEquals(40, key.getRowId());
assertEquals(120, key.getCurrentWriteId());
assertEquals("third", value(pair.nextRecord()));
pair.next(pair.nextRecord());
assertEquals(40, key.getWriteId());
assertEquals(50, key.getBucketProperty());
assertEquals(60, key.getRowId());
assertEquals(130, key.getCurrentWriteId());
assertEquals("fourth", value(pair.nextRecord()));
pair.next(pair.nextRecord());
assertEquals(null, pair.nextRecord());
Mockito.verify(recordReader).close();
}
Aggregations