Class Schema
- java.lang.Object
-
- org.apache.flink.table.legacy.descriptors.Schema
-
- All Implemented Interfaces:
Descriptor
@Deprecated @Internal public class Schema extends Object implements Descriptor
Deprecated.This class was used for legacy connectors usingDescriptor
.Describes a schema of a table.Note: Field names are matched by the exact name by default (case sensitive).
-
-
Field Summary
Fields Modifier and Type Field Description static String
SCHEMA
Deprecated.static String
SCHEMA_DATA_TYPE
Deprecated.static String
SCHEMA_FROM
Deprecated.static String
SCHEMA_NAME
Deprecated.static String
SCHEMA_PROCTIME
Deprecated.static String
SCHEMA_TYPE
Deprecated.Schema
uses the legacy type key (e.g. schema.0.type = LONG) to store type information in prior v1.9.
-
Constructor Summary
Constructors Constructor Description Schema()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Schema
field(String fieldName, String fieldType)
Deprecated.Adds a field with the field name and the type string.Schema
field(String fieldName, org.apache.flink.api.common.typeinfo.TypeInformation<?> fieldType)
Deprecated.This method will be removed in future versions as it uses the old type system.Schema
field(String fieldName, DataType fieldType)
Deprecated.Adds a field with the field name and the data type.Schema
from(String originFieldName)
Deprecated.Specifies the origin of the previously defined field.Schema
proctime()
Deprecated.Specifies the previously defined field as a processing-time attribute.Schema
rowtime(Rowtime rowtime)
Deprecated.Specifies the previously defined field as an event-time attribute.Schema
schema(TableSchema schema)
Deprecated.Sets the schema with field names and the types.Map<String,String>
toProperties()
Deprecated.Converts this descriptor into a set of properties.
-
-
-
Field Detail
-
SCHEMA
public static final String SCHEMA
Deprecated.- See Also:
- Constant Field Values
-
SCHEMA_NAME
public static final String SCHEMA_NAME
Deprecated.- See Also:
- Constant Field Values
-
SCHEMA_TYPE
@Deprecated public static final String SCHEMA_TYPE
Deprecated.- See Also:
- Constant Field Values
-
SCHEMA_DATA_TYPE
public static final String SCHEMA_DATA_TYPE
Deprecated.- See Also:
- Constant Field Values
-
SCHEMA_PROCTIME
public static final String SCHEMA_PROCTIME
Deprecated.- See Also:
- Constant Field Values
-
SCHEMA_FROM
public static final String SCHEMA_FROM
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
schema
public Schema schema(TableSchema schema)
Deprecated.Sets the schema with field names and the types. Required.This method overwrites existing fields added with
field(String, DataType)
.- Parameters:
schema
- the table schema
-
field
public Schema field(String fieldName, DataType fieldType)
Deprecated.Adds a field with the field name and the data type. Required. This method can be called multiple times. The call order of this method defines also the order of the fields in a row.- Parameters:
fieldName
- the field namefieldType
- the type information of the field
-
field
@Deprecated public Schema field(String fieldName, org.apache.flink.api.common.typeinfo.TypeInformation<?> fieldType)
Deprecated.This method will be removed in future versions as it uses the old type system. Please usefield(String, DataType)
instead.Adds a field with the field name and the type information. Required. This method can be called multiple times. The call order of this method defines also the order of the fields in a row.- Parameters:
fieldName
- the field namefieldType
- the type information of the field
-
field
public Schema field(String fieldName, String fieldType)
Deprecated.Adds a field with the field name and the type string. Required. This method can be called multiple times. The call order of this method defines also the order of the fields in a row.NOTE: the fieldType string should follow the type string defined in
LogicalTypeParser
. This method also keeps compatible with old type string defined inTypeStringUtils
but will be dropped in future versions as it uses the old type system.- Parameters:
fieldName
- the field namefieldType
- the type string of the field
-
from
public Schema from(String originFieldName)
Deprecated.Specifies the origin of the previously defined field. The origin field is defined by a connector or format.E.g. field("myString", Types.STRING).from("CSV_MY_STRING")
Note: Field names are matched by the exact name by default (case sensitive).
-
proctime
public Schema proctime()
Deprecated.Specifies the previously defined field as a processing-time attribute.E.g. field("proctime", Types.SQL_TIMESTAMP).proctime()
-
rowtime
public Schema rowtime(Rowtime rowtime)
Deprecated.Specifies the previously defined field as an event-time attribute.E.g. field("rowtime", Types.SQL_TIMESTAMP).rowtime(...)
-
toProperties
public Map<String,String> toProperties()
Deprecated.Converts this descriptor into a set of properties.- Specified by:
toProperties
in interfaceDescriptor
-
-