Skip to content

fix: union coercion coerces to string instead of number#23046

Open
zyuiop wants to merge 1 commit into
apache:mainfrom
zyuiop:fix/coalesce-string
Open

fix: union coercion coerces to string instead of number#23046
zyuiop wants to merge 1 commit into
apache:mainfrom
zyuiop:fix/coalesce-string

Conversation

@zyuiop

@zyuiop zyuiop commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Aligns the behavior of coercion with type_union_coercion.

In an union of types containing both Int and String, String is a better type as all Int can be cast to String, but not all String can be cast to Int.

What changes are included in this PR?

When coercing an union that contains both strings and ints, coerce to string instead of int.

Are these changes tested?

Covered by existing tests I assume

Are there any user-facing changes?

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.

coalesce(Int, Utf8) coerces to Int

1 participant