Class TupleBuilder
java.lang.Object
org.apache.drill.exec.record.metadata.TupleBuilder
Internal tuple builder shared by the schema and map builders.
Those two classes can't inherit from this class because their
versions of the "add" methods return themselves to allow fluent
construction.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String name, TypeProtos.MajorType type) void
add
(String name, TypeProtos.MinorType type) void
add
(String name, TypeProtos.MinorType type, int width) void
add
(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode) void
add
(MaterializedField col) void
addArray
(String name, TypeProtos.MinorType type) void
addArray
(String name, TypeProtos.MinorType type, int dims) Add a multi-dimensional array, implemented as a repeated vector along with 0 or more repeated list vectors.void
addColumn
(ColumnMetadata column) void
addDecimal
(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode, int precision, int scale) addDictArray
(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) Add a map column.addMapArray
(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) void
addNullable
(String name, TypeProtos.MinorType type) void
addNullable
(String name, TypeProtos.MinorType type, int width) addRepeatedList
(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) schema()
-
Constructor Details
-
TupleBuilder
public TupleBuilder()
-
-
Method Details
-
addColumn
-
add
-
add
-
add
-
add
-
add
-
addNullable
-
addNullable
-
addArray
-
addDecimal
public void addDecimal(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode, int precision, int scale) -
addArray
Add a multi-dimensional array, implemented as a repeated vector along with 0 or more repeated list vectors.- Parameters:
name
- column nametype
- base data typedims
- number of dimensions, 1 or more
-
addMap
Add a map column. The returned schema builder is for the nested map. Building that map, usingMapBuilder.resumeSchema()
, will return the original schema builder.- Parameters:
parent
- schema containername
- the name of the map column- Returns:
- a builder for the map
-
addMapArray
public MapBuilder addMapArray(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) -
addDict
public DictBuilder addDict(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) -
addDictArray
public DictBuilder addDictArray(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) -
addUnion
public UnionBuilder addUnion(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) -
addList
public UnionBuilder addList(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) -
addRepeatedList
public RepeatedListBuilder addRepeatedList(org.apache.drill.exec.record.metadata.SchemaContainer parent, String name) -
schema
-