Schema and ResolvedSchema. Use Schema for
declaration in APIs. ResolvedSchema is offered by the framework after resolution and
validation.@Deprecated @PublicEvolving public class TableSchema extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
TableSchema.Builder
已过时。
Builder for creating a
TableSchema. |
| 构造器和说明 |
|---|
TableSchema(String[] fieldNames,
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes)
已过时。
Use the
TableSchema.Builder instead. |
| 限定符和类型 | 方法和说明 |
|---|---|
static TableSchema.Builder |
builder()
已过时。
|
TableSchema |
copy()
已过时。
Returns a deep copy of the table schema.
|
boolean |
equals(Object o)
已过时。
|
static TableSchema |
fromResolvedSchema(ResolvedSchema resolvedSchema)
已过时。
Helps to migrate to the new
ResolvedSchema to old API methods. |
static TableSchema |
fromTypeInfo(org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
已过时。
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)
已过时。
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)
已过时。
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()
已过时。
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. |
Optional<UniqueConstraint> |
getPrimaryKey()
已过时。
|
Optional<TableColumn> |
getTableColumn(int fieldIndex)
已过时。
Returns the
TableColumn instance for the given field index. |
Optional<TableColumn> |
getTableColumn(String fieldName)
已过时。
Returns the
TableColumn instance for the given field name. |
List<TableColumn> |
getTableColumns()
已过时。
Returns all the
TableColumns for this table schema. |
List<WatermarkSpec> |
getWatermarkSpecs()
已过时。
Returns a list of the watermark specification which contains rowtime attribute and watermark
strategy expression.
|
int |
hashCode()
已过时。
|
DataType |
toPersistedRowDataType()
已过时。
Converts all persisted columns of this schema into a (possibly nested) row data type.
|
DataType |
toPhysicalRowDataType()
已过时。
Converts all physical columns of this schema into a (possibly nested) row data type.
|
DataType |
toRowDataType()
已过时。
Converts all columns of this schema into a (possibly nested) row data type.
|
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
toRowType()
已过时。
Use
toRowDataType() instead. |
Schema |
toSchema()
已过时。
Helps to migrate to the new
Schema class. |
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 Optional<TableColumn> getTableColumn(int fieldIndex)
TableColumn instance for the given field index.fieldIndex - the index of the fieldpublic Optional<TableColumn> getTableColumn(String fieldName)
TableColumn instance for the given field name.fieldName - the name of the fieldpublic List<TableColumn> getTableColumns()
TableColumns for this table schema.public DataType toRowDataType()
This method returns the source-to-query schema.
Note: The returned row data type contains physical, computed, and metadata columns. Be
careful when using this method in a table source or table sink. In many cases, toPhysicalRowDataType() might be more appropriate.
public DataType toPhysicalRowDataType()
Note: The returned row data type contains only physical columns. It does not include computed or metadata columns.
public DataType toPersistedRowDataType()
This method returns the query-to-sink schema.
Note: Computed columns and virtual columns are excluded in the returned row data type. The
data type contains the columns of toPhysicalRowDataType() plus persisted metadata
columns.
@Deprecated public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> toRowType()
toRowDataType() instead.public List<WatermarkSpec> getWatermarkSpecs()
NOTE: Currently, there is at most one WatermarkSpec in the list, because we don't
support multiple watermarks definition yet. But in the future, we may support multiple
watermarks.
public Optional<UniqueConstraint> getPrimaryKey()
@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 fromResolvedSchema(ResolvedSchema resolvedSchema)
ResolvedSchema to old API methods.public static TableSchema.Builder builder()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.