Skip to content

Conversation

@feiniaofeiafei
Copy link
Contributor

@feiniaofeiafei feiniaofeiafei commented Apr 18, 2024

select sum(a) c1, min(a) c1 from t1 group by b order by c1;
This pr make the bind logic in order by list same with mysql. Doris used to report error in this situation, but mysql bind to the first c1.
When there are more than one c1 in agg outputs, the c1 in order by should bind to the first c1 in projection.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 19, 2024
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@starocean999 starocean999 merged commit c04416b into apache:master Apr 19, 2024
morrySnow pushed a commit that referenced this pull request May 16, 2024
)

Do same job with pr #32758 and pr #33843.
Because the master branch2.0 differ in binding order by expressions. So this pr is not a cherry-pick, but actually does same job.
For each order by expression:
If it does not have aggregate functions, firstly bind expression from aggregate outputs. If not found, then bind expression from aggregate child outputs.
If it has aggregate functions, firstly bind expression from aggregate outputs which do not have aggregate functions. If not found, then bind expression from aggregate child outputs.


Co-authored-by: feiniaofeiafei <moailing@selectdb.com>
mongo360 pushed a commit to mongo360/doris that referenced this pull request Aug 16, 2024
…che#34606)

Do same job with pr apache#32758 and pr apache#33843.
Because the master branch2.0 differ in binding order by expressions. So this pr is not a cherry-pick, but actually does same job.
For each order by expression:
If it does not have aggregate functions, firstly bind expression from aggregate outputs. If not found, then bind expression from aggregate child outputs.
If it has aggregate functions, firstly bind expression from aggregate outputs which do not have aggregate functions. If not found, then bind expression from aggregate child outputs.

Co-authored-by: feiniaofeiafei <moailing@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/2.0.11-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants