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 using Descriptor.
Describes a schema of a table.

Note: Field names are matched by the exact name by default (case sensitive).

  • Field Details

  • Constructor Details

    • Schema

      public Schema()
      Deprecated.
  • Method Details

    • 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 name
      fieldType - 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 use field(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 name
      fieldType - 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 in TypeStringUtils but will be dropped in future versions as it uses the old type system.

      Parameters:
      fieldName - the field name
      fieldType - 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 interface Descriptor