Class IcebergWriterCompatV1MetadataValidatorAndUpdater
Object
io.delta.kernel.internal.icebergcompat.IcebergCompatMetadataValidatorAndUpdater
io.delta.kernel.internal.icebergcompat.IcebergWriterCompatV1MetadataValidatorAndUpdater
public class IcebergWriterCompatV1MetadataValidatorAndUpdater
extends IcebergCompatMetadataValidatorAndUpdater
Performs the validations and updates necessary to support the table feature IcebergWriterCompatV1
when it is enabled by the table property "delta.enableIcebergWriterCompatV1".
Requires that the following table properties are set to the specified values. If they are set to an invalid value, throws an exception. If they are not set, enable them if possible.
- Requires ID column mapping mode (cannot be enabled on existing table).
- Requires icebergCompatV2 to be enabled.
Checks that required table features are enabled: icebergCompatWriterV1, icebergCompatV2, columnMapping
Checks the following:
- Checks that all table features supported in the table's protocol are in the allow-list of table features. This simultaneously ensures that any unsupported features are not present (e.g. CDF, variant type, etc).
- Checks that there are no fields with data type byte or short.
- Checks that the table feature `invariants` is not active in the table (i.e. there are no invariants in the table schema). This is a special case where the incompatible feature `invariants` is in the allow-list of features since it is included by default in the table protocol for new tables. Since it is incompatible we must verify that it is inactive in the table.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.delta.kernel.internal.icebergcompat.IcebergCompatMetadataValidatorAndUpdater
IcebergCompatMetadataValidatorAndUpdater.IcebergCompatInputContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvalidateAndUpdateIcebergWriterCompatV1Metadata(boolean isCreatingNewTable, Metadata newMetadata, Protocol newProtocol, Optional<Protocol> prevProtocol) Validate and update the given Iceberg Writer Compat V1 metadata.static voidValidates that any change to propertyTableConfig.ICEBERG_WRITER_COMPAT_V1_ENABLEDis valid (for existing table).Methods inherited from class io.delta.kernel.internal.icebergcompat.IcebergCompatMetadataValidatorAndUpdater
isIcebergCompatEnabled
-
Constructor Details
-
IcebergWriterCompatV1MetadataValidatorAndUpdater
public IcebergWriterCompatV1MetadataValidatorAndUpdater()
-
-
Method Details
-
validateIcebergWriterCompatV1Change
public static void validateIcebergWriterCompatV1Change(Map<String, String> oldConfig, Map<String, String> newConfig) Validates that any change to propertyTableConfig.ICEBERG_WRITER_COMPAT_V1_ENABLEDis valid (for existing table). Currently, the changes we support are- No change in enablement (true to true or false to false)
KernelExceptionare- Disabling on an existing table (true to false)
- Enabling on an existing table (false to true)
-
validateAndUpdateIcebergWriterCompatV1Metadata
public static Optional<Metadata> validateAndUpdateIcebergWriterCompatV1Metadata(boolean isCreatingNewTable, Metadata newMetadata, Protocol newProtocol, Optional<Protocol> prevProtocol) Validate and update the given Iceberg Writer Compat V1 metadata.- Parameters:
newMetadata- Metadata after the current updatesnewProtocol- Protocol after the current updates- Returns:
- The updated metadata if the metadata is valid and updated, otherwise empty.
- Throws:
UnsupportedOperationException- if the metadata is not compatible with Iceberg Writer V1 requirements
-