@Internal public static class FactoryUtil.DefaultDynamicTableContext extends Object implements DynamicTableFactory.Context
DynamicTableFactory.Context
.Constructor and Description |
---|
DefaultDynamicTableContext(ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary) |
Modifier and Type | Method and Description |
---|---|
ResolvedCatalogTable |
getCatalogTable()
Returns the resolved table information received from the
Catalog . |
ClassLoader |
getClassLoader()
Returns the class loader of the current session.
|
ReadableConfig |
getConfiguration()
Gives read-only access to the configuration of the current session.
|
ObjectIdentifier |
getObjectIdentifier()
Returns the identifier of the table in the
Catalog . |
boolean |
isTemporary()
Whether the table is temporary.
|
public DefaultDynamicTableContext(ObjectIdentifier objectIdentifier, ResolvedCatalogTable catalogTable, ReadableConfig configuration, ClassLoader classLoader, boolean isTemporary)
public ObjectIdentifier getObjectIdentifier()
DynamicTableFactory.Context
Catalog
.getObjectIdentifier
in interface DynamicTableFactory.Context
public ResolvedCatalogTable getCatalogTable()
DynamicTableFactory.Context
Catalog
.
The ResolvedCatalogTable
forwards the metadata from the catalog but offers a
validated ResolvedSchema
. The original metadata object is available via ResolvedCatalogTable.getOrigin()
.
In most cases, a factory is interested in the following two characteristics:
// get the physical data type to initialize the connector
context.getCatalogTable().getResolvedSchema().toPhysicalRowDataType()
// get primary key information if the connector supports upserts
context.getCatalogTable().getResolvedSchema().getPrimaryKey()
Other characteristics such as metadata columns or watermarks will be pushed down into
the created DynamicTableSource
or DynamicTableSink
during planning
depending on the implemented ability interfaces.
getCatalogTable
in interface DynamicTableFactory.Context
public ReadableConfig getConfiguration()
DynamicTableFactory.Context
getConfiguration
in interface DynamicTableFactory.Context
public ClassLoader getClassLoader()
DynamicTableFactory.Context
The class loader is in particular useful for discovering further (nested) factories.
getClassLoader
in interface DynamicTableFactory.Context
public boolean isTemporary()
DynamicTableFactory.Context
isTemporary
in interface DynamicTableFactory.Context
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.