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

   ### What problem does this PR solve?
   
   Related PR: #67812
   
   Problem Summary:
   
   Backport the fix that prevents internal aggregate slots added for HAVING 
analysis from leaking into the query output. Without the final projection, a 
scalar subquery such as `SELECT (SELECT 1 FROM t HAVING SUM(id) > 0)` is 
incorrectly treated as returning two columns.
   
   The implementation is adapted to branch-4.1's older `FILL_UP_HAVING_PROJECT` 
rule by restoring the original project output after HAVING consumes the helper 
aggregate slot, without bringing in unrelated later analysis-rule refactoring.
   
   ### Release note
   
   Fix false multi-column errors for scalar subqueries whose aggregate appears 
only in HAVING.
   
   ### Check List (For Author)
   
   - Test
       - [x] Unit Test
       - [x] Regression test coverage included
   - Behavior changed:
       - [x] Yes. Internal HAVING helper outputs are no longer exposed as query 
outputs.
   - Does this need documentation?
       - [x] No.
   
   Test details:
   
   - `FillUpMissingSlotsTest` and `NormalizeAggregateTest`: 30 tests passed.
   - Full FE Maven reactor: `BUILD SUCCESS`.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   


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