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

bug (optimizer): optimized TopN causing fails in create mv #7992

Closed
y-wei opened this issue Feb 17, 2023 · 0 comments · Fixed by #7993
Closed

bug (optimizer): optimized TopN causing fails in create mv #7992

y-wei opened this issue Feb 17, 2023 · 0 comments · Fixed by #7993
Assignees
Labels
component/optimizer Query optimization. component/streaming Stream processing related issue. type/bug Something isn't working
Milestone

Comments

@y-wei
Copy link
Contributor

y-wei commented Feb 17, 2023

Describe the bug

The optimized version of TopN on index by #7726 will create a LogicalLimit node, which is forbidden in materialize views.

To Reproduce

dev=> create materialized view mv1 as select v1 from t order by v1 limit 1;
ERROR:  QueryError: Invalid input syntax: The LIMIT clause can not appear alone in a streaming query. Please add an ORDER BY clause before the LIMIT

Expected behavior

No response

Additional context

How can we manage this case? Ideas needed!

@y-wei y-wei added type/bug Something isn't working component/streaming Stream processing related issue. component/optimizer Query optimization. labels Feb 17, 2023
@github-actions github-actions bot added this to the release-0.1.18 milestone Feb 17, 2023
@y-wei y-wei self-assigned this Feb 17, 2023
@mergify mergify bot closed this as completed in #7993 Feb 17, 2023
mergify bot pushed a commit that referenced this issue Feb 17, 2023
Fix #7992 by apply `TopN` on index optimization into `gen_batch_plan` part.

Please explain **IN DETAIL** what the changes are in this PR and why they are needed:

- Summarize your change (**mandatory**)
Fix #7992 by apply `TopN` on index optimization into `gen_batch_plan` part. One planner test is added.

Approved-By: BugenZhao
Approved-By: chenzl25

Co-Authored-By: Clearlove <yifei.c.wei@gmail.com>
Co-Authored-By: Clearlove <52417396+Eurekaaw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/optimizer Query optimization. component/streaming Stream processing related issue. type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant