@PublicEvolving public final class CatalogTableBuilder extends org.apache.flink.table.descriptors.TableDescriptor<CatalogTableBuilder>
CatalogTable.
It takes Descriptors which allow for declaring the communication to external systems
in an implementation-agnostic way. The classpath is scanned for suitable table factories that
match the desired configuration.
Use the provided builder methods to configure the catalog table accordingly.
The following example shows how to read from a connector using a JSON format and declaring it
as a table source:
CatalogTable table = new CatalogTableBuilder(
new ExternalSystemXYZ()
.version("0.11"),
new TableSchema.Builder()
.fields(names, dataTypes)
.build())
.withFormat(
new Json()
.jsonSchema("{...}")
.failOnMissingField(false))
.withComment("test comment")
.build()
| Constructor and Description |
|---|
CatalogTableBuilder(org.apache.flink.table.descriptors.ConnectorDescriptor connectorDescriptor,
org.apache.flink.table.api.TableSchema tableSchema) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,String> |
additionalProperties() |
org.apache.flink.table.catalog.CatalogTable |
build()
Builds a
CatalogTable. |
CatalogTableBuilder |
withComment(String comment) |
CatalogTableBuilder |
withPartitionKeys(List<String> partitionKeys) |
CatalogTableBuilder |
withProperties(Map<String,String> properties) |
public CatalogTableBuilder(org.apache.flink.table.descriptors.ConnectorDescriptor connectorDescriptor,
org.apache.flink.table.api.TableSchema tableSchema)
public CatalogTableBuilder withComment(String comment)
public CatalogTableBuilder withProperties(Map<String,String> properties)
public CatalogTableBuilder withPartitionKeys(List<String> partitionKeys)
public org.apache.flink.table.catalog.CatalogTable build()
CatalogTable.protected Map<String,String> additionalProperties()
additionalProperties in class org.apache.flink.table.descriptors.TableDescriptor<CatalogTableBuilder>Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.