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

query(fuse): limit push down respect orders #4818

Merged
merged 5 commits into from
Apr 13, 2022

Conversation

sundy-li
Copy link
Member

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Summary about this PR

Changelog

  • Bug Fix

Related Issues

Fixes #4807

@vercel
Copy link

vercel bot commented Apr 12, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/databend/databend/4gHYNRusoCX7YrVaUh6n3AhUuEaU
✅ Preview: https://databend-git-fork-sundy-li-orderby-limit-databend.vercel.app

@mergify
Copy link
Contributor

mergify bot commented Apr 12, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Apr 12, 2022
Copy link
Member

@dantengsky dantengsky left a comment

Choose a reason for hiding this comment

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

LGTM

@TCeason
Copy link
Collaborator

TCeason commented Apr 12, 2022

That’s cool

.as_ref()
.and_then(|p| p.limit)
.unwrap_or(usize::MAX);
let mut limit = usize::MAX;
Copy link
Member

Choose a reason for hiding this comment

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

How about:

let limit = push_downs
            .as_ref()
            .filter(|p| p.order_by.is_empty())
            .and_then(|p| p.limit)
            .unwrap_or(usize::MAX);

Copy link
Member Author

Choose a reason for hiding this comment

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

How about:

let limit = push_downs
            .as_ref()
            .filter(|p| p.order_by.is_empty())
            .and_then(|p| p.limit)
            .unwrap_or(usize::MAX);

That's great, I did not come up with this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: If use SELECT LIMIT query a table that the data is not batch insert the result of query will not stable
5 participants