Class MapBuilder
java.lang.Object
org.apache.drill.exec.record.metadata.MapBuilder
Internal structure for building a map. A map is just a schema,
but one that is part of a parent column.
Class can be created with and without parent container.
In the first case, column is added to the parent container during creation
and all resumeXXX methods return qualified parent container.
In the second case column is created without parent container as standalone entity.
All resumeXXX methods do not produce any action and return null.
To access built column
buildColumn()
should be used.-
Constructor Summary
ConstructorDescriptionMapBuilder
(String memberName, TypeProtos.DataMode mode) MapBuilder
(org.apache.drill.exec.record.metadata.SchemaContainer parent, String memberName, TypeProtos.DataMode mode) -
Method Summary
Modifier and TypeMethodDescriptionadd
(String name, TypeProtos.MajorType type) add
(String name, TypeProtos.MinorType type) add
(String name, TypeProtos.MinorType type, int width) add
(String name, TypeProtos.MinorType type, int precision, int scale) add
(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode) add
(MaterializedField col) addArray
(String name, TypeProtos.MinorType type) addArray
(String name, TypeProtos.MinorType type, int dims) addArray
(String name, TypeProtos.MinorType type, int precision, int scale) void
addColumn
(ColumnMetadata column) addDecimal
(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode, int precision, int scale) addDict
(String name, TypeProtos.MajorType keyType) addDict
(String name, TypeProtos.MinorType keyType) addDictArray
(String name, TypeProtos.MajorType keyType) addDictArray
(String name, TypeProtos.MinorType keyType) addDynamic
(String name) Add a map column.addMapArray
(String name) addNullable
(String name, TypeProtos.MinorType type) addNullable
(String name, TypeProtos.MinorType type, int width) addNullable
(String name, TypeProtos.MinorType type, int precision, int scale) addRepeatedList
(String name) void
build()
-
Constructor Details
-
MapBuilder
-
MapBuilder
public MapBuilder(org.apache.drill.exec.record.metadata.SchemaContainer parent, String memberName, TypeProtos.DataMode mode)
-
-
Method Details
-
addColumn
-
add
-
add
-
add
-
add
-
add
-
add
-
addNullable
-
addNullable
-
addNullable
-
addArray
-
addArray
-
addArray
-
addDynamic
-
addDecimal
public MapBuilder addDecimal(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode, int precision, int scale) -
addMap
Add a map column. The returned schema builder is for the nested map. Building that map, usingresumeSchema()
, will return the original schema builder.- Parameters:
name
- the name of the map column- Returns:
- a builder for the map
-
addMapArray
-
addUnion
-
addList
-
addRepeatedList
-
addDict
-
addDict
-
addDictArray
-
addDictArray
-
buildColumn
-
build
public void build() -
resumeSchema
-
resumeMap
-
resumeList
-
resumeUnion
-
resumeDict
-