Package org.apache.flink.table.api
Class TableDescriptor
- java.lang.Object
-
- org.apache.flink.table.api.TableDescriptor
-
@PublicEvolving public class TableDescriptor extends Object
Describes aCatalogTable
representing a source or sink.A
TableDescriptor
is a template for creating aCatalogTable
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)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TableDescriptor.Builder
Builder forTableDescriptor
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
TableDescriptor(Schema schema, Map<String,String> options, TableDistribution distribution, List<String> partitionKeys, String comment)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object obj)
static TableDescriptor.Builder
forConnector(String connector)
Creates a newTableDescriptor.Builder
for a table using the given connector.static TableDescriptor.Builder
forManaged()
Deprecated.This method will be removed soon.Optional<String>
getComment()
Optional<TableDistribution>
getDistribution()
Map<String,String>
getOptions()
List<String>
getPartitionKeys()
Optional<Schema>
getSchema()
int
hashCode()
TableDescriptor.Builder
toBuilder()
Converts this immutable instance into a mutableTableDescriptor.Builder
.CatalogTable
toCatalogTable()
Converts this descriptor into aCatalogTable
.String
toString()
-
-
-
Method Detail
-
forConnector
public static TableDescriptor.Builder forConnector(String connector)
Creates a newTableDescriptor.Builder
for a table using the given connector.- Parameters:
connector
- The factory identifier for the connector.
-
forManaged
@Deprecated public static TableDescriptor.Builder forManaged()
Deprecated.This method will be removed soon. Please see FLIP-346 for more details.Creates a newTableDescriptor.Builder
for a managed table.
-
getDistribution
public Optional<TableDistribution> getDistribution()
-
toCatalogTable
public CatalogTable toCatalogTable()
Converts this descriptor into aCatalogTable
.
-
toBuilder
public TableDescriptor.Builder toBuilder()
Converts this immutable instance into a mutableTableDescriptor.Builder
.
-
-