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

Feat(clickhouse): add support for LIMIT BY clause #2926

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

georgesittas
Copy link
Collaborator

Addresses https://tobiko-data.slack.com/archives/C0448SFS3PF/p1707220020280219.

Based on https://clickhouse.com/docs/en/sql-reference/statements/select/limit-by, it seems like we can also have

LIMIT n OFFSET offset_value BY expressions

This PR doesn't handle this version properly, at least not yet. I wasn't sure how we wanna do this, provided that OFFSET is treated as a separate modifier. Should we just add an expressions arg to exp.Offset and do something similar in its parser / generator?

@georgesittas
Copy link
Collaborator Author

georgesittas commented Feb 7, 2024

Should we just add an expressions arg to exp.Offset and do something similar in its parser / generator

Ended up implementing this, also fixed the LIMIT offset, n BY expressions case which was generated erroneously.

@georgesittas georgesittas merged commit 1842c96 into main Feb 7, 2024
5 checks passed
@georgesittas georgesittas deleted the jo/limit_by_clickhouse branch February 7, 2024 21:04
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.

None yet

2 participants