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 data types #1285

Merged
merged 2 commits into from
Jun 7, 2024
Merged

ClickHouse data types #1285

merged 2 commits into from
Jun 7, 2024

Conversation

7phs
Copy link
Contributor

@7phs 7phs commented May 24, 2024

ClickHouse has a number of data types that specific for ClickHouse.

This PR includes support of the following data types of ClickHouse:

  • Nullable - ClickHouse uses a special data type to allow to store special marker (NULL) that denotes “missing value” alongside normal values. A default value of option related to nullability of values defines that values are not-nullable. Additionally, ClickHouse transforms SQL definition String NULL -> Nullable(String) in DDL of table;
  • All integer and unsigned integers and float data types;
  • String related data types;
  • Date/time data types;
  • Non-experimental nested data types: Nested, Tuple (not-named and named), Array, Map;
  • LowCardinality - internal representation of other data types to be dictionary-encoded.

@coveralls
Copy link

coveralls commented May 24, 2024

Pull Request Test Coverage Report for Build 9369161985

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

  • 211 of 240 (87.92%) changed or added relevant lines in 3 files are covered.
  • 1058 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.7%) to 88.802%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 77 86 89.53%
src/ast/data_type.rs 27 47 57.45%
Files with Coverage Reduction New Missed Lines %
src/ast/data_type.rs 2 77.46%
tests/sqlparser_snowflake.rs 12 98.09%
tests/sqlparser_postgres.rs 301 87.83%
src/parser/mod.rs 347 93.06%
src/ast/mod.rs 396 80.85%
Totals Coverage Status
Change from base Build 9316234549: -0.7%
Covered Lines: 25733
Relevant Lines: 28978

💛 - Coveralls

src/ast/data_type.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
@alamb
Copy link
Contributor

alamb commented May 30, 2024

Thank you for the review @iffyio 🙏

@7phs 7phs force-pushed the click-house-data-types branch from 9fc9938 to 2026abc Compare May 31, 2024 06:52
@7phs 7phs requested a review from iffyio May 31, 2024 09:45
@7phs 7phs force-pushed the click-house-data-types branch from 7d37a0d to 03282a1 Compare May 31, 2024 09:50
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.

Left a couple minor comments otherwise LGTM! Thanks @7phs!
cc @alamb

src/parser/mod.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
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.

Thank you @7phs and @iffyio

@alamb alamb merged commit 2fb919d into apache:main Jun 7, 2024
10 checks passed
@iffyio iffyio deleted the click-house-data-types branch July 16, 2024 11:37
lustefaniak pushed a commit to getsynq/sqlparser-rs that referenced this pull request Sep 11, 2024
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