Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #47179

…nditions and the… (#47179)

### What problem does this PR solve?
fix wrong result when case when have more than 256 conditions and then
column is not nullable
### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Jan 24, 2025
@hello-stephen
Copy link
Contributor

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.42% (9571/26277)
Line Coverage: 28.01% (79110/282455)
Region Coverage: 26.64% (40505/152060)
Branch Coverage: 23.40% (20534/87766)
Coverage Report: http://coverage.selectdb-in.cc/coverage/247734913927760e45443dc588ee6e87d5e940b1_247734913927760e45443dc588ee6e87d5e940b1/report/index.html

then_idx_ptr[row_idx] = i;
break;
}
if (!then_idx_ptr[row_idx] && when_column_ptr->get_bool(row_idx)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的判断条件跟 256 是什么关系呢?为啥超过 256 的时候之前的代码会有问题

Copy link
Contributor

Choose a reason for hiding this comment

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

小于256会走其他逻辑
没有判断when_column_ptr->get_bool(row_idx)相当于没有判断when条件是否为true就短路了

Copy link
Contributor

@zhiqiang-hhhh zhiqiang-hhhh left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor Author

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit 2ae03d7 into branch-2.1 Jan 25, 2025
21 of 22 checks passed
@github-actions github-actions bot deleted the auto-pick-47179-branch-2.1 branch January 25, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants