public class TableFeatures
extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DOMAIN_METADATA_FEATURE_NAME
The feature name for domain metadata.
|
static int |
TABLE_FEATURES_MIN_WRITER_VERSION
The minimum writer version required to support table features.
|
| Constructor and Description |
|---|
TableFeatures() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Set<String> |
extractAutomaticallyEnabledWriterFeatures(Metadata metadata,
Protocol protocol)
Extract the writer features that should be enabled automatically based on the metadata which
are not already enabled.
|
static boolean |
isDomainMetadataSupported(Protocol protocol)
Checks if the table protocol supports the "domainMetadata" writer feature.
|
static Tuple2<Integer,Integer> |
minProtocolVersionFromAutomaticallyEnabledFeatures(java.util.Set<String> enabledFeatures)
Given the automatically enabled features from Delta table metadata, returns the minimum
required reader and writer version that satisfies all enabled table features in the metadata.
|
static void |
validateReadSupportedTable(Protocol protocol,
String tablePath,
java.util.Optional<Metadata> metadata) |
static void |
validateWriteSupportedTable(Protocol protocol,
Metadata metadata,
StructType tableSchema,
String tablePath)
Utility method to validate whether the given table is supported for writing from Kernel.
|
public static final String DOMAIN_METADATA_FEATURE_NAME
public static final int TABLE_FEATURES_MIN_WRITER_VERSION
public static void validateReadSupportedTable(Protocol protocol, String tablePath, java.util.Optional<Metadata> metadata)
public static void validateWriteSupportedTable(Protocol protocol, Metadata metadata, StructType tableSchema, String tablePath)
appendOnly, inCommitTimestamp, columnMapping, typeWidening, domainMetadata feature enabled.
protocol - Table protocolmetadata - Table metadatatableSchema - Table schemapublic static Tuple2<Integer,Integer> minProtocolVersionFromAutomaticallyEnabledFeatures(java.util.Set<String> enabledFeatures)
enabledFeatures - the automatically enabled features from the Delta table metadatapublic static java.util.Set<String> extractAutomaticallyEnabledWriterFeatures(Metadata metadata, Protocol protocol)
inCommitTimestamp feature should be enabled
when the delta property name (delta.enableInCommitTimestamps) is set to true in the metadata if
it is not already enabled.metadata - the metadata of the tableprotocol - the protocol of the tablepublic static boolean isDomainMetadataSupported(Protocol protocol)
protocol - the protocol to check