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

Add support of FORMAT clause for ClickHouse parser #1335

Merged

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Jul 8, 2024

ClickHouse allows to use the FORMAT clause to choose the select result format:

SELECT * FORM table FORMAT NULL|Identifier

For more information, please refer to:

https://clickhouse.com/docs/en/sql-reference/statements/select/format

SelectInto, SelectItem, SetExpr, SetOperator, SetQuantifier, Setting, SymbolDefinition, Table,
TableAlias, TableFactor, TableVersion, TableWithJoins, Top, TopQuantity, ValueTableMode,
Values, WildcardAdditionalOptions, With,
FormatClause, GroupByExpr, GroupByWithModifier, IdentWithAlias, IlikeSelectItem, Join,
Copy link
Member Author

Choose a reason for hiding this comment

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

Only FormatClause was introduced by this PR, other lines are auto-formated by the cargo fmt.

@git-hulk git-hulk force-pushed the feature/clickchouse-query-format-clause branch from 3c4c5c1 to 4e1e85f Compare July 8, 2024 12:08
@coveralls
Copy link

coveralls commented Jul 8, 2024

Pull Request Test Coverage Report for Build 9839312926

Details

  • 57 of 57 (100.0%) changed or added relevant lines in 7 files are covered.
  • 12 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.02%) to 89.197%

Files with Coverage Reduction New Missed Lines %
tests/sqlparser_mssql.rs 1 92.92%
src/parser/mod.rs 1 93.32%
tests/sqlparser_postgres.rs 4 87.91%
tests/sqlparser_common.rs 6 89.65%
Totals Coverage Status
Change from base Build 9838850938: 0.02%
Covered Lines: 26644
Relevant Lines: 29871

💛 - Coveralls

ClickHouse allows to use the FORMAT clause to choose the select result
format:

`SELECT * FORM table FORMAT NULL|Identifier`

For more information, please refer to:

https://clickhouse.com/docs/en/sql-reference/statements/select/format
@git-hulk git-hulk force-pushed the feature/clickchouse-query-format-clause branch from 4e1e85f to 6776f83 Compare July 8, 2024 12:11
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.

Looks great to me -- thank you @git-hulk

@alamb alamb merged commit 0727895 into apache:main Jul 9, 2024
10 checks passed
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.

3 participants