use of org.apache.drill.exec.record.metadata.RepeatedListBuilder in project drill by apache.
the class TestSchemaBuilder method testStandaloneRepeatedListBuilder.
@Test
public void testStandaloneRepeatedListBuilder() {
ColumnMetadata columnMetadata = new RepeatedListBuilder("l").addMapArray().addNullable("v", MinorType.VARCHAR).add("i", MinorType.INT).resumeList().buildColumn();
assertTrue(columnMetadata.isArray());
assertEquals("l", columnMetadata.name());
assertEquals(MinorType.LIST, columnMetadata.type());
ColumnMetadata child = columnMetadata.childSchema();
assertEquals("l", child.name());
assertTrue(child.isArray());
assertTrue(child.isMap());
TupleMetadata mapSchema = child.tupleSchema();
ColumnMetadata col0 = mapSchema.metadata(0);
assertEquals("v", col0.name());
assertEquals(MinorType.VARCHAR, col0.type());
assertTrue(col0.isNullable());
ColumnMetadata col1 = mapSchema.metadata(1);
assertEquals("i", col1.name());
assertEquals(MinorType.INT, col1.type());
assertFalse(col1.isNullable());
}
Aggregations