@PublicEvolving public class TableSchema extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TableSchema.Builder
Builder for creating a
TableSchema . |
Constructor and Description |
---|
TableSchema(String[] fieldNames,
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes)
Deprecated.
Use the
TableSchema.Builder instead. |
Modifier and Type | Method and Description |
---|---|
static TableSchema.Builder |
builder() |
TableSchema |
copy()
Returns a deep copy of the table schema.
|
boolean |
equals(Object o) |
static TableSchema |
fromTypeInfo(org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
Deprecated.
This method will be removed soon. Use
DataTypes to declare types. |
int |
getFieldCount()
Returns the number of fields.
|
Optional<DataType> |
getFieldDataType(int fieldIndex)
Returns the specified data type for the given field index.
|
Optional<DataType> |
getFieldDataType(String fieldName)
Returns the specified data type for the given field name.
|
DataType[] |
getFieldDataTypes()
Returns all field data types as an array.
|
Optional<String> |
getFieldName(int fieldIndex)
Returns the specified name for the given field index.
|
String[] |
getFieldNames()
Returns all field names as an array.
|
Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> |
getFieldType(int fieldIndex)
Deprecated.
This method will be removed in future versions as it uses the old type system. It
is recommended to use
getFieldDataType(int) instead which uses the new type
system based on DataTypes . Please make sure to use either the old or the new
type system consistently to avoid unintended behavior. See the website documentation
for more information. |
Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> |
getFieldType(String fieldName)
Deprecated.
This method will be removed in future versions as it uses the old type system. It
is recommended to use
getFieldDataType(String) instead which uses the new type
system based on DataTypes . Please make sure to use either the old or the new
type system consistently to avoid unintended behavior. See the website documentation
for more information. |
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getFieldTypes()
Deprecated.
This method will be removed in future versions as it uses the old type system. It
is recommended to use
getFieldDataTypes() instead which uses the new type
system based on DataTypes . Please make sure to use either the old or the new
type system consistently to avoid unintended behavior. See the website documentation
for more information. |
int |
hashCode() |
DataType |
toRowDataType()
Converts a table schema into a (nested) data type describing a
DataTypes.ROW(Field...) . |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
toRowType()
Deprecated.
Use
toRowDataType() instead. |
String |
toString() |
@Deprecated public TableSchema(String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes)
TableSchema.Builder
instead.public TableSchema copy()
public DataType[] getFieldDataTypes()
@Deprecated public org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getFieldTypes()
getFieldDataTypes()
instead which uses the new type
system based on DataTypes
. Please make sure to use either the old or the new
type system consistently to avoid unintended behavior. See the website documentation
for more information.public Optional<DataType> getFieldDataType(int fieldIndex)
fieldIndex
- the index of the field@Deprecated public Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> getFieldType(int fieldIndex)
getFieldDataType(int)
instead which uses the new type
system based on DataTypes
. Please make sure to use either the old or the new
type system consistently to avoid unintended behavior. See the website documentation
for more information.public Optional<DataType> getFieldDataType(String fieldName)
fieldName
- the name of the field@Deprecated public Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> getFieldType(String fieldName)
getFieldDataType(String)
instead which uses the new type
system based on DataTypes
. Please make sure to use either the old or the new
type system consistently to avoid unintended behavior. See the website documentation
for more information.public int getFieldCount()
public String[] getFieldNames()
public Optional<String> getFieldName(int fieldIndex)
fieldIndex
- the index of the fieldpublic DataType toRowDataType()
DataTypes.ROW(Field...)
.@Deprecated public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> toRowType()
toRowDataType()
instead.@Deprecated public static TableSchema fromTypeInfo(org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
DataTypes
to declare types.TypeInformation
instance. If the type information is
a CompositeType
, the field names and types for the composite type are used to
construct the TableSchema
instance. Otherwise, a table schema with a single field
is created. The field name is "f0" and the field type the provided type.typeInfo
- The TypeInformation
from which the table schema is generated.TypeInformation
.public static TableSchema.Builder builder()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.