IcebergTypesComparator

@Singleton
class IcebergTypesComparator

Compares two Iceberg Schema definitions (including nested structs) to identify:

  • New columns that do not exist in the "existing" schema.

  • Columns whose data types have changed.

  • Columns that no longer exist in the incoming schema (removed).

  • Columns that changed from required to optional.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class ColumnDiff(val newColumns: MutableList<String> = mutableListOf(), val updatedDataTypes: MutableList<String> = mutableListOf(), val removedColumns: MutableList<String> = mutableListOf(), val newlyOptionalColumns: MutableList<String> = mutableListOf(), var identifierFieldsChanged: Boolean = false)

A data class representing differences between two Iceberg schemas.

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun compareSchemas(incomingSchema: Schema, existingSchema: Schema): IcebergTypesComparator.ColumnDiff

Compares incomingSchema with existingSchema, returning a ColumnDiff.

Link copied to clipboard
fun typesAreEqual(incomingType: Type, existingType: Type): Boolean

Checks if two Iceberg Types are semantically equal by comparing type IDs and any relevant sub-properties (e.g., for timestamps, lists, structs).