Search in sources :

Example 1 with MutableRecord

use of org.apache.hive.hcatalog.streaming.mutate.MutableRecord in project hive by apache.

the class TestBucketIdResolverImpl method testAttachBucketIdToRecord.

@Test
public void testAttachBucketIdToRecord() {
    MutableRecord record = new MutableRecord(1, "hello");
    capturingBucketIdResolver.attachBucketIdToRecord(record);
    assertThat(record.rowId, is(new RecordIdentifier(-1L, 1, -1L)));
    assertThat(record.id, is(1));
    assertThat(record.msg.toString(), is("hello"));
}
Also used : RecordIdentifier(org.apache.hadoop.hive.ql.io.RecordIdentifier) MutableRecord(org.apache.hive.hcatalog.streaming.mutate.MutableRecord) Test(org.junit.Test)

Example 2 with MutableRecord

use of org.apache.hive.hcatalog.streaming.mutate.MutableRecord in project hive by apache.

the class TestRecordInspectorImpl method testExtractRecordIdentifier.

@Test
public void testExtractRecordIdentifier() {
    RecordIdentifier recordIdentifier = new RecordIdentifier(10L, 4, 20L);
    MutableRecord record = new MutableRecord(1, "hello", recordIdentifier);
    assertThat(inspector.extractRecordIdentifier(record), is(recordIdentifier));
}
Also used : RecordIdentifier(org.apache.hadoop.hive.ql.io.RecordIdentifier) MutableRecord(org.apache.hive.hcatalog.streaming.mutate.MutableRecord) Test(org.junit.Test)

Aggregations

RecordIdentifier (org.apache.hadoop.hive.ql.io.RecordIdentifier)2 MutableRecord (org.apache.hive.hcatalog.streaming.mutate.MutableRecord)2 Test (org.junit.Test)2