@Evolving public enum TableCatalogCapability extends Enum<TableCatalogCapability>
TableCatalog
implementation.
TableCatalogs use TableCatalog.capabilities()
to return a set of capabilities. Each
capability signals to Spark that the catalog supports a feature identified by the capability.
For example, returning SUPPORTS_CREATE_TABLE_WITH_GENERATED_COLUMNS
allows Spark to
accept GENERATED ALWAYS AS
expressions in CREATE TABLE
statements.
Enum Constant and Description |
---|
SUPPORT_COLUMN_DEFAULT_VALUE
Signals that the TableCatalog supports defining column default value as expression in
CREATE/REPLACE/ALTER TABLE.
|
SUPPORTS_CREATE_TABLE_WITH_GENERATED_COLUMNS
Signals that the TableCatalog supports defining generated columns upon table creation in SQL.
|
Modifier and Type | Method and Description |
---|---|
static TableCatalogCapability |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TableCatalogCapability[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TableCatalogCapability SUPPORTS_CREATE_TABLE_WITH_GENERATED_COLUMNS
Without this capability, any create/replace table statements with a generated column defined in the table schema will throw an exception during analysis.
A generated column is defined with syntax: colName colType GENERATED ALWAYS AS (expr)
Generation expression are included in the column definition for APIs like
TableCatalog.createTable(org.apache.spark.sql.connector.catalog.Identifier, org.apache.spark.sql.types.StructType, org.apache.spark.sql.connector.expressions.Transform[], java.util.Map<java.lang.String, java.lang.String>)
.
See Column.generationExpression()
.
public static final TableCatalogCapability SUPPORT_COLUMN_DEFAULT_VALUE
Without this capability, any CREATE/REPLACE/ALTER TABLE statement with a column default value defined in the table schema will throw an exception during analysis.
A column default value is defined with syntax: colName colType DEFAULT expr
Column default value expression is included in the column definition for APIs like
TableCatalog.createTable(org.apache.spark.sql.connector.catalog.Identifier, org.apache.spark.sql.types.StructType, org.apache.spark.sql.connector.expressions.Transform[], java.util.Map<java.lang.String, java.lang.String>)
.
See Column.defaultValue()
.
public static TableCatalogCapability[] values()
for (TableCatalogCapability c : TableCatalogCapability.values()) System.out.println(c);
public static TableCatalogCapability valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null