Class ColumnDefaults

Object
io.delta.kernel.internal.columndefaults.ColumnDefaults

public class ColumnDefaults extends Object
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 Details

    • ColumnDefaults

      public ColumnDefaults()
  • Method Details

    • blockWriteIfEnabled

      public static void blockWriteIfEnabled(Row transactionState)
      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 schema
      isEnabled - 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

      public static void validateSchemaForIcebergCompat(StructType schema, String compatVersion)
      Validate that the schema only contains literal default values as a requirement of IcebergCompat.
      Parameters:
      schema - table schema
    • getRawDefaultValue

      public static String getRawDefaultValue(StructField field)