Skip to content

Fix union branch resolution for primitive promotion#603

Open
arkorwan wants to merge 1 commit intolinkedin:masterfrom
arkorwan:support_promotable_in_union
Open

Fix union branch resolution for primitive promotion#603
arkorwan wants to merge 1 commit intolinkedin:masterfrom
arkorwan:support_promotable_in_union

Conversation

@arkorwan
Copy link
Copy Markdown

Summary

This change fixes fastserde union resolution for schema evolution cases where a writer primitive should be promoted to a compatible reader primitive inside a union.

Previously, fastserde could fail on cases like:

writer: ["null", "int"]
reader: ["null", "long"]

What changed

  • SchemaAssistant.areTypesCompatible(...) now recognizes valid primitive promotions in addition to exact matches.
  • Reader union branch selection now uses that compatibility logic consistently.
  • Exact matches still win over promotions in case there are multiple matches.
  • Added a regression test for ["null","int"] -> ["null","long"].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant