Class TableDescriptor

java.lang.Object
org.apache.flink.table.api.TableDescriptor

@PublicEvolving public class TableDescriptor extends Object
Describes a CatalogTable representing a source or sink.

A TableDescriptor is a template for creating a CatalogTable instance. It closely resembles the "CREATE TABLE" SQL DDL statement, containing schema, connector options, and other characteristics. Since tables in Flink are typically backed by external systems, the descriptor describes how a connector (and possibly its format) are configured.

This can be used to register a table in the Table API, see TableEnvironment.createTemporaryTable(String, TableDescriptor).

  • Constructor Details

    • TableDescriptor

      protected TableDescriptor(@Nullable org.apache.flink.table.api.Schema schema, Map<String,String> options, @Nullable org.apache.flink.table.catalog.TableDistribution distribution, List<String> partitionKeys, @Nullable String comment)
  • Method Details

    • forConnector

      public static TableDescriptor.Builder forConnector(String connector)
      Creates a new TableDescriptor.Builder for a table using the given connector.
      Parameters:
      connector - The factory identifier for the connector.
    • getSchema

      public Optional<org.apache.flink.table.api.Schema> getSchema()
    • getOptions

      public Map<String,String> getOptions()
    • getDistribution

      public Optional<org.apache.flink.table.catalog.TableDistribution> getDistribution()
    • getPartitionKeys

      public List<String> getPartitionKeys()
    • getComment

      public Optional<String> getComment()
    • toCatalogTable

      public org.apache.flink.table.catalog.CatalogTable toCatalogTable()
      Converts this descriptor into a CatalogTable.
    • toBuilder

      public TableDescriptor.Builder toBuilder()
      Converts this immutable instance into a mutable TableDescriptor.Builder.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object