Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 5, 2025

Cherry-picked from #48492

…48492)

### What problem does this PR solve?

Related PR: #40937

Problem Summary:

We want to provide clearer error messages for window functions with
ORDER BY parameters. However, the current error checking incorrectly
inspects all child nodes instead of just the immediate/direct child
nodes. As a result, when nested window functions are present, this may
trigger unexpected error reporting.

```sql
errCode = 2, detailMessage = order by is not supported in max(dense_rank() WindowSpec(PARTITION BY lot_no#0 ORDER BY loading_time#20 asc null first)) 
```

### 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:
apache/doris-website#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 -->
@github-actions github-actions bot requested a review from dataroaring as a code owner March 5, 2025 06:29
@Thearas
Copy link
Contributor

Thearas commented Mar 5, 2025

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Mar 5, 2025
@dataroaring dataroaring reopened this Mar 5, 2025
@Thearas
Copy link
Contributor

Thearas commented Mar 5, 2025

run buildall

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dataroaring dataroaring merged commit f4aefd0 into branch-3.0 Mar 10, 2025
22 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-48492-branch-3.0 branch March 10, 2025 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants