public static class RelDataTypeFactory.Builder extends Object
| Constructor and Description |
|---|
Builder(RelDataTypeFactory typeFactory)
Creates a Builder with the given type factory.
|
| Modifier and Type | Method and Description |
|---|---|
RelDataTypeFactory.Builder |
add(RelDataTypeField field)
Adds a field.
|
RelDataTypeFactory.Builder |
add(String name,
RelDataType type)
Adds a field with given name and type.
|
RelDataTypeFactory.Builder |
add(String name,
SqlTypeName typeName)
Adds a field with a type created using
RelDataTypeFactory.createSqlType(org.apache.calcite.sql.type.SqlTypeName). |
RelDataTypeFactory.Builder |
add(String name,
SqlTypeName typeName,
int precision)
Adds a field with a type created using
RelDataTypeFactory.createSqlType(org.apache.calcite.sql.type.SqlTypeName, int). |
RelDataTypeFactory.Builder |
add(String name,
SqlTypeName typeName,
int precision,
int scale)
Adds a field with a type created using
RelDataTypeFactory.createSqlType(org.apache.calcite.sql.type.SqlTypeName, int, int). |
RelDataTypeFactory.Builder |
add(String name,
org.apache.calcite.avatica.util.TimeUnit startUnit,
int startPrecision,
org.apache.calcite.avatica.util.TimeUnit endUnit,
int fractionalSecondPrecision)
Adds a field with an interval type.
|
RelDataTypeFactory.Builder |
addAll(Iterable<? extends Map.Entry<String,RelDataType>> fields)
Adds all fields in a collection.
|
RelDataType |
build()
Creates a struct type with the current contents of this builder.
|
RelDataType |
buildDynamic()
Creates a dynamic struct type with the current contents of this
builder.
|
int |
getFieldCount()
Returns the number of fields.
|
String |
getFieldName(int index)
Returns the name of a given field.
|
RelDataType |
getFieldType(int index)
Returns the type of a given field.
|
RelDataTypeFactory.Builder |
kind(StructKind kind) |
boolean |
nameExists(String name)
Returns whether a field exists with the given name.
|
RelDataTypeFactory.Builder |
nullable(boolean nullable)
Changes the nullability of the last field added.
|
RelDataTypeFactory.Builder |
nullableRecord(boolean nullableRecord)
Sets whether the record type will be nullable.
|
RelDataTypeFactory.Builder |
uniquify()
Makes sure that field names are unique.
|
public Builder(RelDataTypeFactory typeFactory)
public int getFieldCount()
public String getFieldName(int index)
index - Ordinal of fieldpublic RelDataType getFieldType(int index)
index - Ordinal of fieldpublic RelDataTypeFactory.Builder add(String name, RelDataType type)
public RelDataTypeFactory.Builder add(String name, SqlTypeName typeName)
RelDataTypeFactory.createSqlType(org.apache.calcite.sql.type.SqlTypeName).public RelDataTypeFactory.Builder add(String name, SqlTypeName typeName, int precision)
RelDataTypeFactory.createSqlType(org.apache.calcite.sql.type.SqlTypeName, int).public RelDataTypeFactory.Builder add(String name, SqlTypeName typeName, int precision, int scale)
RelDataTypeFactory.createSqlType(org.apache.calcite.sql.type.SqlTypeName, int, int).public RelDataTypeFactory.Builder add(String name, org.apache.calcite.avatica.util.TimeUnit startUnit, int startPrecision, org.apache.calcite.avatica.util.TimeUnit endUnit, int fractionalSecondPrecision)
public RelDataTypeFactory.Builder nullable(boolean nullable)
IndexOutOfBoundsException - if no fields have been
addedpublic RelDataTypeFactory.Builder add(RelDataTypeField field)
public RelDataTypeFactory.Builder addAll(Iterable<? extends Map.Entry<String,RelDataType>> fields)
public RelDataTypeFactory.Builder kind(StructKind kind)
public RelDataTypeFactory.Builder nullableRecord(boolean nullableRecord)
public RelDataTypeFactory.Builder uniquify()
public RelDataType build()
public RelDataType buildDynamic()
public boolean nameExists(String name)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.