-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](nereids) fix subquery unnest can not found aggregate slot #51086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
morrySnow
reviewed
May 20, 2025
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubqueryToApply.java
Outdated
Show resolved
Hide resolved
TPC-H: Total hot run time: 33889 ms |
TPC-DS: Total hot run time: 193380 ms |
ClickBench: Total hot run time: 28.91 s |
a6b4186 to
d0843f9
Compare
Contributor
Author
|
run buildall |
morrySnow
approved these changes
May 21, 2025
morrySnow
approved these changes
May 21, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
starocean999
approved these changes
May 21, 2025
TPC-H: Total hot run time: 34242 ms |
TPC-DS: Total hot run time: 186838 ms |
ClickBench: Total hot run time: 29.2 s |
github-actions bot
pushed a commit
that referenced
this pull request
May 22, 2025
when exists multiple subquery in a query block
```sql
select case
when t1.k1=1 then (select count(*) from t2 where t1.k2=t2.k2) -- count(*)#7
when t1.k1=2 then (select count(*) from t3 where t1.k2=t3.k2) -- count(*)#12
else 0 end as kk
from t1
order by kk
```
the aggregate function output maybe bind failed and then throw exception
```
org.apache.doris.nereids.exceptions.AnalysisException: Input slot(s) not in child's output: count(*)#7
```
because we only replace the last aggregate function slot(only replace
the `#12`, but not replace the `#7` ):
this pr fix subquery unnest can not found aggregate slot, introduced by
#39471
koarz
pushed a commit
to koarz/doris
that referenced
this pull request
Jun 4, 2025
…he#51086) when exists multiple subquery in a query block ```sql select case when t1.k1=1 then (select count(*) from t2 where t1.k2=t2.k2) -- count(*)apache#7 when t1.k1=2 then (select count(*) from t3 where t1.k2=t3.k2) -- count(*)apache#12 else 0 end as kk from t1 order by kk ``` the aggregate function output maybe bind failed and then throw exception ``` org.apache.doris.nereids.exceptions.AnalysisException: Input slot(s) not in child's output: count(*)apache#7 ``` because we only replace the last aggregate function slot(only replace the `apache#12`, but not replace the `apache#7` ): this pr fix subquery unnest can not found aggregate slot, introduced by apache#39471
Hastyshell
pushed a commit
to Hastyshell/doris
that referenced
this pull request
Jul 21, 2025
…e slot apache#51086 (apache#51137) Cherry-picked from apache#51086 Co-authored-by: 924060929 <lanhuajian@selectdb.com>
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/3.0.6-merged
reviewed
usercase
Important user case type label
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
when exists multiple subquery in a query block
the aggregate function output maybe bind failed and then throw exception
because we only replace the last aggregate function slot(only replace the
#12, but not replace the#7):this pr fix subquery unnest can not found aggregate slot, introduced by #39471
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)