Preserve original field order during schema evolution #96
+2
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This overcomes a limitation with how Hudi syncs schemas to the Glue catalog. Previously, if version
1-0-0
of a schema had fieldsa
andb
, and then vesion1-0-1
adds a fieldc
, then the new field might be added before the original fields in the Hudi schema. The new field would get synced to Glue, but only for new partitions; it is not back-filled to existing partitions.After this change, the new field
c
is added after the original fieldsa
andb
in the Hudi schema. Then there is no need to sync the new field to existing partitions in Glue.The problem manifested in AWS Athena with a message like:
This fix was implemented in snowplow/schema-ddl#213 and snowplow-incubator/common-streams#98 and imported via a new version of common-streams.
This change does not impact Delta or Iceberg, where nothing was broken.