Skip to content

Conversation

@xy720
Copy link
Member

@xy720 xy720 commented Sep 29, 2020

Proposed changes

Fix #4692
The reason of this bug is case-when statement may produce implicit CastExpr<SlotRef> as SelectListItem in analyze step.
And these CastExpr<SlotRef> in SelectList will not be re-anlyze after rewrite step, which will result in the incorrect number of self-incrementing SlotDescriptor ID in resultExprs .

So we need to reset the analysis state of CastExpr<SlotRef> in rewrite step.

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have create an issue on (Fix [Bug] Duplicate columns in case when statement #4692 ), and have described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morningman morningman added approved Indicates a PR has been approved by one committer. area/planner Issues or PRs related to the query planner kind/fix Categorizes issue or PR as related to a bug. labels Oct 4, 2020
@morningman morningman merged commit 6ab858b into apache:master Oct 10, 2020
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
yiguolei pushed a commit to yiguolei/incubator-doris that referenced this pull request Sep 28, 2025
Hastyshell pushed a commit to Hastyshell/doris that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/planner Issues or PRs related to the query planner kind/fix Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Duplicate columns in case when statement

2 participants