@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) |
| 限定符和类型 | 方法和说明 |
|---|---|
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)
Creates a table schema from a
TypeInformation instance. |
String[] |
getColumnNames()
已过时。
Use
getFieldNames() instead. Can be dropped after 1.7. |
int |
getFieldCount()
Returns the number of fields.
|
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)
Returns the specified type information for the given field index.
|
Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> |
getFieldType(String fieldName)
Returns the specified type information for the given field name.
|
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getFieldTypes()
Returns all field type information as an array.
|
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getTypes()
已过时。
Use
getFieldTypes() instead. Can be dropped after 1.7. |
int |
hashCode() |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
toRowType()
Converts a table schema into a (nested) type information describing a
Row. |
String |
toString() |
public TableSchema(String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes)
public TableSchema copy()
public org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getFieldTypes()
public Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> getFieldType(int fieldIndex)
fieldIndex - the index of the fieldpublic Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> getFieldType(String fieldName)
fieldName - the name of the fieldpublic int getFieldCount()
public String[] getFieldNames()
public Optional<String> getFieldName(int fieldIndex)
fieldIndex - the index of the field@Deprecated public org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getTypes()
getFieldTypes() instead. Can be dropped after 1.7.@Deprecated public String[] getColumnNames()
getFieldNames() instead. Can be dropped after 1.7.public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> toRowType()
Row.public static TableSchema fromTypeInfo(org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
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.