Skip to content
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

panic may happen when limit is on top of window functions #25344

Closed
eurekaka opened this issue Jun 10, 2021 · 1 comment · Fixed by #25345
Closed

panic may happen when limit is on top of window functions #25344

eurekaka opened this issue Jun 10, 2021 · 1 comment · Fixed by #25345
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug. type/enhancement The issue or PR belongs to an enhancement.

Comments

@eurekaka
Copy link
Contributor

eurekaka commented Jun 10, 2021

Development Task

create table t(a int);
insert into t values(1);
select count(a) f1, row_number() over (order by count(a)) as f2 from t limit 1;

the select query would panic. Root cause is that, wrong column pruning for limit would lead to a bad plan that the schema of limit has more columns than its child schema.

The problem is incurred by #20288 when trying to do inline projection for limit, which changes limit from baseLogicalPlan to a logicalSchemaProducer.

@eurekaka eurekaka added type/bug The issue is confirmed as a bug. type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Jun 10, 2021
@eurekaka eurekaka self-assigned this Jun 10, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants