Skip to content

DeltaColumnMappingMode

DeltaColumnMappingMode is an abstraction of the column mapping modes in Column Mapping.

Contract

Name

name: String

Human-friendly name of this DeltaColumnMappingMode (for error reporting)

Used when:

Implementations

Sealed Trait

DeltaColumnMappingMode is a Scala sealed trait which means that all of the implementations are in the same compilation unit (a single file).

Learn more in the Scala Language Specification.

IdMapping

This mode uses the column ID as the identifier of a column.

Name: id

Used for tables converted from Apache Iceberg.

This mode requires a new protocol

NameMapping

Name: name

NameMapping is the only allowed mapping mode change (from NoMapping)

This mode requires a new protocol

NameMapping is among the supportedModes

NameMapping is used when:

NoMapping

No column mapping and the display name of a column is the only valid identifier to read and write data.

Name: none

This mode does not require a new protocol

NoMapping is among the supportedModes

Creating DeltaColumnMappingMode

apply(
  name: String): DeltaColumnMappingMode

apply returns the DeltaColumnMappingMode for the given name (if defined) or throws a ColumnMappingUnsupportedException:

The column mapping mode `[mode]` is not supported for this Delta version.
Please upgrade if you want to use this mode.

apply is used when: