Mryange opened a new pull request, #70744:
URL: https://github.com/apache/doris/pull/70744

   ### Background
   
   The analytic sink buffers window-function input columns across blocks and 
prunes rows that are no longer needed. It maintains separate buffers for 
aggregate inputs and for partition and order keys.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #68210 (single-value aggregate states now own selected values)
   PR Type: Bugfix
   
   Problem Summary:
   Some single-value aggregate states previously retained references to input 
columns, so window pruning had to mutate columns in place through 
IColumn::erase. PR #68210 changed these states to own their selected values, 
allowing pruning to replace columns with cut() results and making erase 
unnecessary. Aggregate input columns also cannot use the ignore-overflow 
insertion path because many aggregate functions do not support ColumnString64. 
Oversized aggregate strings now raise the normal overflow error, while 
partition and order keys keep their existing promotion path.
   
   ### Details
   
   - **Change map:** Production code removes 154 lines and adds 30. The change 
removes the IColumn::erase API and its column implementations, switches 
analytic pruning to cut(), and removes 651 lines of erase-specific unit tests. 
Aggregate input columns use checked range insertion, while partition and order 
key columns retain ignore-overflow insertion and ColumnString64 promotion.
   - **Frequency:** The overflow occurs when buffered window aggregate string 
inputs exceed the 4 GiB limit.
   - **Root cause:** The analytic sink used ignore-overflow insertion for 
aggregate inputs, even though downstream aggregate functions may not accept 
ColumnString64.
   - **Why existing tests missed it:** Existing tests did not exercise a window 
aggregate input exceeding the string-column limit across blocks.
   - **Fix:** Use ordinary insert_range_from() for aggregate inputs, preserve 
the key-column promotion path, replace row pruning with cut(), and remove 
IColumn::erase.
   - **Other paths and branches:** Partition and order keys may still promote 
to ColumnString64 because their comparison path supports it.
   
   ### Testing
   
   - Passed: BUILD_TYPE=ASAN ./build.sh --be -j48 on the development machine.
   - Passed: build-support/check-build-hygiene.sh.
   - Passed: build-support/check-format.sh with clang-format 16.
   - Not run: BE unit tests and regression tests.
   
   ### Notes for Reviewers
   
   PR #68210 replaced single-value aggregate states that retained input-column 
references with states that own their selected values. This removes the 
lifetime constraint that required in-place erase during window row pruning.
   
   ### Release note
   
   Window-function aggregate string inputs that exceed the 4 GiB string-column 
limit now fail with a string overflow error instead of continuing through an 
unsupported 64-bit column path.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details).
   - Does this need documentation: No.
   - Pre-submission status: Partially verified. BE build, hygiene, and 
formatting passed. Unit and regression tests were not run.
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6).
   - Generated: BE source changes, removal of erase-specific unit tests, and 
this description.
   - Human review: The user reviewed the synchronized BE source changes before 
authorizing PR submission.
   


-- 
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]

Reply via email to