@PublicEvolving public final class CatalogTableBuilder extends TableDescriptor<CatalogTableBuilder>
CatalogTable
.
It takes Descriptor
s 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(ConnectorDescriptor connectorDescriptor,
TableSchema tableSchema) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
additionalProperties()
Enables adding more specific properties to
TableDescriptor.toProperties() . |
CatalogTable |
build()
Builds a
CatalogTable . |
CatalogTableBuilder |
withComment(String comment) |
CatalogTableBuilder |
withPartitionKeys(List<String> partitionKeys) |
CatalogTableBuilder |
withProperties(Map<String,String> properties) |
inAppendMode, inRetractMode, inUpsertMode, toProperties, withFormat
toString
public CatalogTableBuilder(ConnectorDescriptor connectorDescriptor, TableSchema tableSchema)
public CatalogTableBuilder withComment(String comment)
public CatalogTableBuilder withProperties(Map<String,String> properties)
public CatalogTableBuilder withPartitionKeys(List<String> partitionKeys)
public CatalogTable build()
CatalogTable
.protected Map<String,String> additionalProperties()
TableDescriptor
TableDescriptor.toProperties()
.additionalProperties
in class TableDescriptor<CatalogTableBuilder>
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.