We use the Migrations.mergeSchema function in the loaders, for combining a series of schemas (e.g. 1-0-0, 1-0-1, 1-0-2) into a reconciled column
Before this PR, mergeSchemas contained some logic to preserve field order... but it was the wrong logic. It preserved field order of the newer schema, ignoring whether a field was present in the older schema.
After this PR, we preserve field order of the older schema. New fields added in a later schema are appended to the end of the field list.
This feature change is needed for loaders that only allow field additions when they are appended to the end of a struct. E.g. the Lake Loader for Hudi/Glue.
We use the
Migrations.mergeSchema
function in the loaders, for combining a series of schemas (e.g.1-0-0
,1-0-1
,1-0-2
) into a reconciled columnBefore this PR,
mergeSchemas
contained some logic to preserve field order... but it was the wrong logic. It preserved field order of the newer schema, ignoring whether a field was present in the older schema.After this PR, we preserve field order of the older schema. New fields added in a later schema are appended to the end of the field list.
This feature change is needed for loaders that only allow field additions when they are appended to the end of a struct. E.g. the Lake Loader for Hudi/Glue.