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

ClickHouse: support of create table query with primary key and parametrised table engine #1289

Merged

Conversation

7phs
Copy link
Contributor

@7phs 7phs commented May 27, 2024

This PR implements extended support of query CREATE TABLE in ClickHouse that contains the following additional parameters and differentiation:

  1. Primary key. It is located before ORDER BY in a CREATE TABLE query;
  2. Table Engine with parameters
  3. ORDER BY can include expression and not only indication.

@coveralls
Copy link

coveralls commented May 27, 2024

Pull Request Test Coverage Report for Build 9369081951

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 75 of 83 (90.36%) changed or added relevant lines in 5 files are covered.
  • 1086 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.8%) to 88.792%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/helpers/stmt_create_table.rs 7 8 87.5%
tests/sqlparser_clickhouse.rs 42 44 95.45%
src/parser/mod.rs 7 12 58.33%
Files with Coverage Reduction New Missed Lines %
tests/sqlparser_snowflake.rs 12 98.09%
src/ast/query.rs 21 84.1%
tests/sqlparser_postgres.rs 301 87.83%
src/parser/mod.rs 351 92.99%
src/ast/mod.rs 401 80.91%
Totals Coverage Status
Change from base Build 9305920914: -0.8%
Covered Lines: 25581
Relevant Lines: 28810

💛 - Coveralls

src/ast/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_clickhouse.rs Outdated Show resolved Hide resolved
tests/sqlparser_clickhouse.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
@7phs 7phs force-pushed the click-house-create-table-with-primary-key branch 2 times, most recently from 7c836ab to 12faee5 Compare May 30, 2024 16:56
@7phs 7phs requested a review from iffyio May 30, 2024 16:57
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! cc @alamb

tests/sqlparser_clickhouse.rs Outdated Show resolved Hide resolved
@7phs
Copy link
Contributor Author

7phs commented Jun 4, 2024

Thanks @iffyio for review!

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.

Love it -- thank you @7phs and @iffyio

@alamb
Copy link
Contributor

alamb commented Jun 7, 2024

Screenshot 2024-06-07 at 7 10 43 AM

It appears this PR has some conflicts that need to be addressed, but then we can merge it in.

Thanks again

@7phs 7phs force-pushed the click-house-create-table-with-primary-key branch from 77f781b to 79327da Compare June 7, 2024 11:24
@7phs
Copy link
Contributor Author

7phs commented Jun 7, 2024

Thanks @alamb for review and that you letting me know about conflicts.

I rebased my PR with main and resolved conflicts.

@alamb alamb merged commit 3c33ac1 into apache:main Jun 7, 2024
10 checks passed
@alamb
Copy link
Contributor

alamb commented Jun 7, 2024

Thanks @7phs !

@iffyio iffyio deleted the click-house-create-table-with-primary-key branch July 16, 2024 11:37
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.

4 participants