[BugFix] Cast COALESCE children to common type in JOIN USING transformer#72338
Conversation
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.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Covers the planner fix for createCoalesceOperator: USING-named columns that have DATETIME on one side and VARCHAR on the other must be wrapped in an explicit CAST to the resolved common type so the synthesized COALESCE has well-typed children. Verifies the queries do not error out and that match / outer-row counts are correct.
Signed-off-by: Hyper-FF <253014618+Hyper-FF@users.noreply.github.com>
|
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 6 / 6 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
|
@Mergifyio backport branch-4.0 |
|
@Mergifyio backport branch-4.1 |
✅ Backports have been createdDetails
Cherry-pick of cb2fd87 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
✅ Backports have been createdDetails
|
…mer (StarRocks#72338) Signed-off-by: Hyper-FF <253014618+Hyper-FF@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
…mer (StarRocks#72338) Signed-off-by: Hyper-FF <253014618+Hyper-FF@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: xiangguangyxg <xiangguangyxg@gmail.com>
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:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: