public static DwrfProto.ColumnEncoding toColumnEncoding(int nodeId, ColumnEncoding columnEncoding)
    {
        checkArgument(
                !columnEncoding.getAdditionalSequenceEncodings().isPresent(),
                "Non-zero sequence IDs for column encoding %s",
                columnEncoding);

        return DwrfProto.ColumnEncoding.newBuilder()
                .setKind(toColumnEncodingKind(columnEncoding.getColumnEncodingKind()))
                .setDictionarySize(columnEncoding.getDictionarySize())
                .setColumn(nodeId)
                .setSequence(0)
                .build();
    }
@Test
    public void testToColumnEncodingDirect()
    {
        int expectedDictionarySize = 0;
        ColumnEncoding columnEncoding = new ColumnEncoding(DIRECT, expectedDictionarySize);

        DwrfProto.ColumnEncoding actual = toColumnEncoding(COLUMN_ID, columnEncoding);

        assertEquals(actual.getColumn(), COLUMN_ID);
        assertEquals(actual.getKind(), DwrfProto.ColumnEncoding.Kind.DIRECT);
        assertEquals(actual.getDictionarySize(), expectedDictionarySize);
        assertEquals(actual.getSequence(), 0);
    }