@PublicEvolving public final class ResolvedCatalogTable extends Object implements ResolvedCatalogBaseTable<CatalogTable>, CatalogTable
CatalogTable
that is backed by the original metadata coming from the Catalog
but resolved by the framework.
Note: Compared to CatalogTable
, instances of this class are serializable for
persistence if and only if the originating CatalogTable
implements CatalogBaseTable.getOptions()
. Catalog implementations are encouraged to use toProperties()
.
CatalogTable.Builder
CatalogBaseTable.TableKind
Constructor and Description |
---|
ResolvedCatalogTable(CatalogTable origin,
ResolvedSchema resolvedSchema) |
Modifier and Type | Method and Description |
---|---|
CatalogBaseTable |
copy()
Get a deep copy of the CatalogBaseTable instance.
|
ResolvedCatalogTable |
copy(Map<String,String> options)
Returns a copy of this
CatalogTable with given table options options . |
boolean |
equals(Object o) |
String |
getComment()
Get comment of the table or view.
|
Optional<String> |
getDescription()
Get a brief description of the table or view.
|
Optional<String> |
getDetailedDescription()
Get a detailed description of the table or view.
|
Optional<TableDistribution> |
getDistribution()
Returns the distribution of the table if the
DISTRIBUTED clause is defined. |
Map<String,String> |
getOptions()
Returns a map of string-based options.
|
CatalogTable |
getOrigin()
Returns the original, unresolved metadata object from the
Catalog . |
List<String> |
getPartitionKeys()
Get the partition keys of the table.
|
ResolvedSchema |
getResolvedSchema()
Returns a fully resolved and validated
ResolvedSchema . |
Optional<Long> |
getSnapshot()
Return the snapshot specified for the table.
|
Schema |
getUnresolvedSchema()
Returns the schema of the table or view.
|
int |
hashCode() |
boolean |
isPartitioned()
Check if the table is partitioned or not.
|
Map<String,String> |
toProperties()
Convenience method for
Catalog implementations for serializing instances of this
class into a map of string properties. |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getSchema
fromProperties, getTableKind, newBuilder, of, of
public ResolvedCatalogTable(CatalogTable origin, ResolvedSchema resolvedSchema)
public CatalogTable getOrigin()
ResolvedCatalogBaseTable
Catalog
.
This method might be useful if catalog-specific object instances should be directly forwarded from the catalog to a factory.
getOrigin
in interface ResolvedCatalogBaseTable<CatalogTable>
public ResolvedSchema getResolvedSchema()
ResolvedCatalogBaseTable
ResolvedSchema
.
Connectors can configure themselves by accessing ResolvedSchema.getPrimaryKey()
and ResolvedSchema.toPhysicalRowDataType()
.
getResolvedSchema
in interface ResolvedCatalogBaseTable<CatalogTable>
public Map<String,String> toProperties()
Catalog
implementations for serializing instances of this
class into a map of string properties. Instances are serializable for persistence if and only
if the originating CatalogTable
implements CatalogBaseTable.getOptions()
.
CatalogTable.fromProperties(Map)
provides the reverse operation for
deserialization. Note that the serialization and deserialization of catalog tables are not
symmetric. The framework will resolve functions and perform other validation tasks. A catalog
implementation must not deal with this during a read operation.
toProperties
in interface CatalogTable
public Map<String,String> getOptions()
CatalogBaseTable
In case of CatalogTable
, these options may determine the kind of connector and its
configuration for accessing the data in the external system. See DynamicTableFactory
for more information. If a CatalogTable
should not be serializable, an implementation
can simply throw a runtime exception in this method.
getOptions
in interface CatalogBaseTable
public Schema getUnresolvedSchema()
CatalogBaseTable
The schema can reference objects from other catalogs and will be resolved and validated by the framework when accessing the table or view.
getUnresolvedSchema
in interface CatalogBaseTable
ResolvedCatalogTable
,
ResolvedCatalogView
public String getComment()
CatalogBaseTable
getComment
in interface CatalogBaseTable
public CatalogBaseTable copy()
CatalogBaseTable
copy
in interface CatalogBaseTable
public Optional<String> getDescription()
CatalogBaseTable
getDescription
in interface CatalogBaseTable
public Optional<String> getDetailedDescription()
CatalogBaseTable
getDetailedDescription
in interface CatalogBaseTable
public boolean isPartitioned()
CatalogTable
isPartitioned
in interface CatalogTable
public List<String> getPartitionKeys()
CatalogTable
getPartitionKeys
in interface CatalogTable
public Optional<Long> getSnapshot()
CatalogTable
getSnapshot
in interface CatalogTable
public Optional<TableDistribution> getDistribution()
CatalogTable
DISTRIBUTED
clause is defined.getDistribution
in interface CatalogTable
public ResolvedCatalogTable copy(Map<String,String> options)
CatalogTable
CatalogTable
with given table options options
.copy
in interface CatalogTable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.