Skip to content

[BugFix] Cast COALESCE children to common type in JOIN USING transformer (backport #72338)#72372

Merged
wanpengfei-git merged 1 commit into
branch-4.1from
mergify/bp/branch-4.1/pr-72338
Apr 30, 2026
Merged

[BugFix] Cast COALESCE children to common type in JOIN USING transformer (backport #72338)#72372
wanpengfei-git merged 1 commit into
branch-4.1from
mergify/bp/branch-4.1/pr-72338

Conversation

@mergify

@mergify mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Why I'm doing:

createCoalesceOperator resolved a common result type for the synthesized USING-projection COALESCE but passed the original left/right operands as children without casting, so the call's actual child types could disagree with the resolved function signature (e.g. DATETIME child under a coalesce(VARCHAR) signature). Wrap children whose type differs from the common type in an implicit CAST and look up the function with {commonType, commonType} so the signature is consistent.

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

This is an automatic backport of pull request #72338 done by [Mergify](https://mergify.com).

…mer (#72338)

Signed-off-by: Hyper-FF <253014618+Hyper-FF@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit cb2fd87)
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@wanpengfei-git wanpengfei-git merged commit cb6e15f into branch-4.1 Apr 30, 2026
38 of 39 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-4.1/pr-72338 branch April 30, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants