Skip to content

Clickhouse: Clickhouse assume table constraint - #2467

Open
pelovett wants to merge 4 commits into
apache:mainfrom
pelovett:clickhouse-assume-table-constraint
Open

Clickhouse: Clickhouse assume table constraint#2467
pelovett wants to merge 4 commits into
apache:mainfrom
pelovett:clickhouse-assume-table-constraint

Conversation

@pelovett

Copy link
Copy Markdown

Resolves: #2466

First time contributing so please let me know if I missed anything!

Comment thread tests/sqlparser_clickhouse.rs
Comment thread src/ast/table_constraints.rs Outdated
pub struct AssumeConstraint {
/// Optional constraint name.
pub name: Option<Ident>,
/// The boolean expression the ASSUME constraint enforces.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ClickHouse's ASSUME is an optimizer assertion that is not enforced and may produce incorrect results when false. Not a constraint, when false it may start doing 2+2=3. It is just an optimization hint as far as I can recall, not an enforced rule.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, updated with a more accurate comment

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.

Support Clickhouse ASSUME table constraints (and remove required parenthetical)

2 participants