Class ColumnDefaults
Object
io.delta.kernel.internal.columndefaults.ColumnDefaults
Utilities class for TableFeature "allowColumnDefaults". NOTE: As of Aug 2025, kernel only
supports reading Delta tables with the table feature, or modifying table metadata. Writing actual
data to the table is not allowed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidblockWriteIfEnabled(Row transactionState) Don't allow data writes to tables with default valuesstatic StringgetRawDefaultValue(StructField field) static voidvalidateSchema(StructType schema, boolean isEnabled, boolean isIcebergCompatV3Enabled) Validate Column Default values in the provided metadata.static voidvalidateSchemaForIcebergCompat(StructType schema, String compatVersion) Validate that the schema only contains literal default values as a requirement of IcebergCompat.
-
Constructor Details
-
ColumnDefaults
public ColumnDefaults()
-
-
Method Details
-
blockWriteIfEnabled
Don't allow data writes to tables with default values -
validateSchema
public static void validateSchema(StructType schema, boolean isEnabled, boolean isIcebergCompatV3Enabled) Validate Column Default values in the provided metadata. Kernel only supports literal default values. See {validateLiteral}.- Parameters:
schema- target table schemaisEnabled- When the feature is disabled, no column default is allowed.isIcebergCompatV3Enabled- Kernel currently requires IcebergCompatV3 to be enabled when using Column Defaults- Throws:
KernelException- when the table contains invalid default value
-
validateSchemaForIcebergCompat
Validate that the schema only contains literal default values as a requirement of IcebergCompat.- Parameters:
schema- table schema
-
getRawDefaultValue
-