jacktengg opened a new pull request, #69037:
URL: https://github.com/apache/doris/pull/69037
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Adding a sample to a QuantileState with 2048 explicit
values converted the existing values to a TDigest but omitted the incoming
sample. Merging 2048 zeros with a singleton 100 consequently returned a maximum
of 0 and total weight 2048, while a different grouping retained all 2049
inputs. Add the triggering sample before clearing the explicit buffer. The
shared add_value path fixes direct additions and both EXPLICIT/SINGLE merge
orders. Add unit coverage for boundary counts, both extrema, compression
limits, merge orders and the EXPLICIT/EXPLICIT control grouping, plus SQL
regression coverage for stored partial states and ordered window merges.
### Release note
Fix lost samples and incorrect quantile results when QUANTILE_STATE crosses
the 2048-sample explicit representation limit.
### Check List (For Author)
- Test:
- Unit Test: ASAN run-be-ut.sh, all 48 QuantileState-related tests
passed. Reverting the fix makes both new boundary tests fail; the control
passes.
- Regression test: run-regression-test.sh,
test_quantile_state_explicit_boundary and test_quantile_state_function passed;
expected output was generated by the runner.
- Manual test: the reported SQL changes from maximum 0 / weight 2048 to
maximum 100 / weight 2049 using the same persisted partial states.
- ASAN BE build, clang-format 16, clang-tidy and build hygiene checks
passed.
- Behavior changed: Yes, retain the sample triggering EXPLICIT-to-TDIGEST
conversion.
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### 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)
- [ ] 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:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/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 -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]