Skip to content

Conversation

@BiteTheDDDDt
Copy link
Contributor

@BiteTheDDDDt BiteTheDDDDt commented Feb 17, 2025

What problem does this PR solve?

  1. add santy check
  2. optimize for ColumnStr::replicate and add char length check
  3. fix ColumnStr::resize get wrong chars size
  4. fix some function's wrong chars size

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@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?

@BiteTheDDDDt
Copy link
Contributor Author

run buildall

@BiteTheDDDDt BiteTheDDDDt changed the title [Improvement](column) optimize for ColumnStr<T>::replicate [Improvement](column) add santy check and optimize for ColumnStr<T>::replicate Feb 17, 2025
@BiteTheDDDDt
Copy link
Contributor Author

run buildall

1 similar comment
@BiteTheDDDDt
Copy link
Contributor Author

run buildall

github-actions bot pushed a commit that referenced this pull request Feb 18, 2025
### What problem does this PR solve?
Sometimes we encounter offset[last]<chars.size(), since we can't
completely avoid this situation at the moment, we will add protective
code here first.

related check&fix : #47964

```cpp
false, DefaultMemoryAllocator>, pad_right_ = 16, pad_left_ = 15]: 假设 ‘(n >= (static_cast<ssize_t>(pad_left_) ? -1 : 0)) && (n <= static_cast<ssize_t>(this->size()))’ 失败。
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/common/signal_handler.h:421
 1# 0x00007F756FE8BB50 in /lib64/libc.so.6
 2# gsignal in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007F756FE84426 in /lib64/libc.so.6
 6# doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>::operator[](long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/common/pod_array.h:365
 7# doris::vectorized::FunctionLikeBase::execute_substring(doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>&, doris::vectorized::LikeSearchState*) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:580
 8# doris::vectorized::FunctionLikeBase::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:532
 9# doris::vectorized::DefaultExecutable::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.h:461
10# doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.cpp:120
```

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] 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.
        - [x] 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)

- [x] Confirm the release note
- [x] Confirm test cases
- [x] Confirm document
- [x] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
github-actions bot pushed a commit that referenced this pull request Feb 18, 2025
### What problem does this PR solve?
Sometimes we encounter offset[last]<chars.size(), since we can't
completely avoid this situation at the moment, we will add protective
code here first.

related check&fix : #47964

```cpp
false, DefaultMemoryAllocator>, pad_right_ = 16, pad_left_ = 15]: 假设 ‘(n >= (static_cast<ssize_t>(pad_left_) ? -1 : 0)) && (n <= static_cast<ssize_t>(this->size()))’ 失败。
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/common/signal_handler.h:421
 1# 0x00007F756FE8BB50 in /lib64/libc.so.6
 2# gsignal in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007F756FE84426 in /lib64/libc.so.6
 6# doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>::operator[](long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/common/pod_array.h:365
 7# doris::vectorized::FunctionLikeBase::execute_substring(doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>&, doris::vectorized::LikeSearchState*) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:580
 8# doris::vectorized::FunctionLikeBase::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:532
 9# doris::vectorized::DefaultExecutable::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.h:461
10# doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.cpp:120
```

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] 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.
        - [x] 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)

- [x] Confirm the release note
- [x] Confirm test cases
- [x] Confirm document
- [x] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@BiteTheDDDDt BiteTheDDDDt reopened this Feb 20, 2025
lzyy2024 pushed a commit to lzyy2024/doris that referenced this pull request Feb 21, 2025
### What problem does this PR solve?
Sometimes we encounter offset[last]<chars.size(), since we can't
completely avoid this situation at the moment, we will add protective
code here first.

related check&fix : apache#47964

```cpp
false, DefaultMemoryAllocator>, pad_right_ = 16, pad_left_ = 15]: 假设 ‘(n >= (static_cast<ssize_t>(pad_left_) ? -1 : 0)) && (n <= static_cast<ssize_t>(this->size()))’ 失败。
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/common/signal_handler.h:421
 1# 0x00007F756FE8BB50 in /lib64/libc.so.6
 2# gsignal in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007F756FE84426 in /lib64/libc.so.6
 6# doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>::operator[](long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/common/pod_array.h:365
 7# doris::vectorized::FunctionLikeBase::execute_substring(doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>&, doris::vectorized::LikeSearchState*) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:580
 8# doris::vectorized::FunctionLikeBase::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:532
 9# doris::vectorized::DefaultExecutable::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.h:461
10# doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.cpp:120
```

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] 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.
        - [x] 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)

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

run buildall

@BiteTheDDDDt
Copy link
Contributor Author

run buildall

@BiteTheDDDDt
Copy link
Contributor Author

run buildall

Copy link
Contributor

@jacktengg jacktengg 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

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Feb 28, 2025
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit e021a6a into apache:master Feb 28, 2025
28 of 31 checks passed
mymeiyi pushed a commit to mymeiyi/doris that referenced this pull request Mar 4, 2025
…replicate (apache#47964)

### What problem does this PR solve?
1. add santy check
2. optimize for ColumnStr<T>::replicate and add char length check
3. fix ColumnStr<T>::resize get wrong chars size
4. fix some function's wrong chars size
csun5285 pushed a commit to csun5285/doris that referenced this pull request Mar 28, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
### What problem does this PR solve?
Sometimes we encounter offset[last]<chars.size(), since we can't
completely avoid this situation at the moment, we will add protective
code here first.

related check&fix : apache#47964

```cpp
false, DefaultMemoryAllocator>, pad_right_ = 16, pad_left_ = 15]: 假设 ‘(n >= (static_cast<ssize_t>(pad_left_) ? -1 : 0)) && (n <= static_cast<ssize_t>(this->size()))’ 失败。
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/common/signal_handler.h:421
 1# 0x00007F756FE8BB50 in /lib64/libc.so.6
 2# gsignal in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007F756FE84426 in /lib64/libc.so.6
 6# doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>::operator[](long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/common/pod_array.h:365
 7# doris::vectorized::FunctionLikeBase::execute_substring(doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned int, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, doris::vectorized::PODArray<unsigned char, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>&, doris::vectorized::LikeSearchState*) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:580
 8# doris::vectorized::FunctionLikeBase::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/like.cpp:532
 9# doris::vectorized::DefaultExecutable::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.h:461
10# doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const at /mnt/disk2/liyuanyuan/doris_test/3.0/doris/be/src/vec/functions/function.cpp:120
```

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] 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.
        - [x] 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)

- [x] Confirm the release note
- [x] Confirm test cases
- [x] Confirm document
- [x] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…replicate (apache#47964)

### What problem does this PR solve?
1. add santy check
2. optimize for ColumnStr<T>::replicate and add char length check
3. fix ColumnStr<T>::resize get wrong chars size
4. fix some function's wrong chars size
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. dev/2.1.9-merged dev/3.0.5-merged p0_c reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants