@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.
Modifier and Type | Interface and Description |
---|---|
static class |
CatalogTable.Builder
Builder for configuring and creating instances of
CatalogTable . |
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() . |
default Optional<TableDistribution> |
getDistribution()
Returns the distribution of the table if the
DISTRIBUTED clause is defined. |
List<String> |
getPartitionKeys()
Get the partition keys of the table.
|
default Optional<Long> |
getSnapshot()
Return the snapshot specified for 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.Builder |
newBuilder()
Builder for configuring and creating instances of
CatalogTable . |
static CatalogTable |
of(Schema schema,
String comment,
List<String> partitionKeys,
Map<String,String> options)
Deprecated.
Use the builder
newBuilder() instead. |
static CatalogTable |
of(Schema schema,
String comment,
List<String> partitionKeys,
Map<String,String> options,
Long snapshot)
Deprecated.
Use the builder
newBuilder() instead. |
default Map<String,String> |
toProperties()
Deprecated.
Only a
ResolvedCatalogTable is serializable to properties. |
copy, getComment, getDescription, getDetailedDescription, getOptions, getSchema, getUnresolvedSchema
@PublicEvolving static CatalogTable.Builder newBuilder()
CatalogTable
.@Deprecated static CatalogTable of(Schema schema, @Nullable String comment, List<String> partitionKeys, Map<String,String> options)
newBuilder()
instead.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 connector@Deprecated static CatalogTable of(Schema schema, @Nullable String comment, List<String> partitionKeys, Map<String,String> options, @Nullable Long snapshot)
newBuilder()
instead.CatalogTable
with a specific snapshot.schema
- unresolved schemacomment
- optional commentpartitionKeys
- list of partition keys or an empty list if not partitionedoptions
- options to configure the connectorsnapshot
- table snapshot of the tablestatic 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.
default Optional<Long> getSnapshot()
default Optional<TableDistribution> getDistribution()
DISTRIBUTED
clause is defined.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.