Skip to content

Add ORDER BY to CreateTable for ClickHouse #478

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

Closed

Conversation

julienfr112
Copy link

Few edits to allow to add order by to create tables.

docs is here :

https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree/

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @julienfr112 -- this is a nice addition. Looking close.

@@ -857,6 +857,8 @@ pub enum Statement {
default_charset: Option<String>,
collation: Option<String>,
on_commit: Option<OnCommit>,
clickhouse_order: Option<Vec<Ident>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please change this field name to order by to match the SQL more closely (and perhaps add a comment that it is to support the clickhouse variant)?

@@ -857,6 +857,8 @@ pub enum Statement {
default_charset: Option<String>,
collation: Option<String>,
on_commit: Option<OnCommit>,
clickhouse_order: Option<Vec<Ident>>,
query_after: Option<Box<Query>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add a comment here that this supports a query at the end of the statement (aka for clickhouse)

@alamb
Copy link
Contributor

alamb commented May 9, 2022

FYI I plan to release 0.17.0 tomorrow in case you want to work on this PR before then: #488

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2240029283

  • 30 of 32 (93.75%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 90.414%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 9 10 90.0%
tests/sqpparser_clickhouse.rs 14 15 93.33%
Files with Coverage Reduction New Missed Lines %
src/ast/mod.rs 1 77.95%
Totals Coverage Status
Change from base Build 2219792542: 0.01%
Covered Lines: 8064
Relevant Lines: 8919

💛 - Coveralls

@alamb
Copy link
Contributor

alamb commented Aug 11, 2022

Marking this as a draft to show it is waiting some changes so I can easily filter out which PRs need review. Please mark it as "ready for review" when it is next ready.

@alamb alamb marked this pull request as draft August 11, 2022 10:47
@alamb
Copy link
Contributor

alamb commented Oct 1, 2022

Closing as stale -- please reopen if you still plan to work on it

@alamb alamb closed this Oct 1, 2022
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.

3 participants