@PublicEvolving public interface CatalogTable extends CatalogBaseTable
Catalog
.
It contains all characteristics that can be expressed in a SQL CREATE TABLE
statement.
The framework will resolve instances of this interface to a ResolvedCatalogTable
before
passing it to a DynamicTableFactory
for creating a connector to an external system.
A catalog implementer can either use of(Schema, String, List, Map)
for a basic
implementation of this interface or create a custom class that allows passing catalog-specific
objects all the way down to the connector creation (if necessary).
Note: The default implementation that is available via of(Schema, String, List, Map)
is always serializable. For example, it can be used for implementing a catalog that uses ResolvedCatalogTable.toProperties()
or for persisting compiled plans. An implementation of this
interface determines whether a catalog table can be serialized by providing a proper CatalogBaseTable.getOptions()
method.
CatalogBaseTable.TableKind
Modifier and Type | Method and Description |
---|---|
CatalogTable |
copy(Map<String,String> options)
Returns a copy of this
CatalogTable with given table options options . |
static CatalogTable |
fromProperties(Map<String,String> properties)
Creates an instance of
CatalogTable from a map of string properties that were
previously created with ResolvedCatalogTable.toProperties() . |
List<String> |
getPartitionKeys()
Get the partition keys of the table.
|
default CatalogBaseTable.TableKind |
getTableKind()
The kind of table this
CatalogBaseTable describes. |
boolean |
isPartitioned()
Check if the table is partitioned or not.
|
static CatalogTable |
of(Schema schema,
String comment,
List<String> partitionKeys,
Map<String,String> options)
Creates a basic implementation of this interface.
|
default Map<String,String> |
toProperties()
Deprecated.
Only a
ResolvedCatalogTable is serializable to properties. |
copy, getComment, getDescription, getDetailedDescription, getOptions, getSchema, getUnresolvedSchema
static CatalogTable of(Schema schema, @Nullable String comment, List<String> partitionKeys, Map<String,String> options)
The signature is similar to a SQL CREATE TABLE
statement.
schema
- unresolved schemacomment
- optional commentpartitionKeys
- list of partition keys or an empty list if not partitionedoptions
- options to configure the connectorstatic CatalogTable fromProperties(Map<String,String> properties)
CatalogTable
from a map of string properties that were
previously created with ResolvedCatalogTable.toProperties()
.
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.
properties
- serialized version of a CatalogTable
that includes schema,
partition keys, and connector optionsdefault CatalogBaseTable.TableKind getTableKind()
CatalogBaseTable
CatalogBaseTable
describes.getTableKind
in interface CatalogBaseTable
boolean isPartitioned()
List<String> getPartitionKeys()
CatalogTable copy(Map<String,String> options)
CatalogTable
with given table options options
.@Deprecated default Map<String,String> toProperties()
ResolvedCatalogTable
is serializable to properties.Compared to the pure table options in CatalogBaseTable.getOptions()
, the map includes schema,
partitioning, and other characteristics in a serialized form.
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.