Clickhouse Dialect - Support BackQuoted Identifiers#5457
Merged
greg-finley merged 4 commits intosqlfluff:mainfrom Dec 11, 2023
Merged
Clickhouse Dialect - Support BackQuoted Identifiers#5457greg-finley merged 4 commits intosqlfluff:mainfrom
greg-finley merged 4 commits intosqlfluff:mainfrom
Conversation
Contributor
Coverage Results ✅ |
greg-finley
reviewed
Dec 10, 2023
Contributor
greg-finley
left a comment
There was a problem hiding this comment.
Looking good, one cleanup request.
| clickhouse_dialect = ansi_dialect.copy_as("clickhouse") | ||
| clickhouse_dialect.sets("unreserved_keywords").update(UNRESERVED_KEYWORDS) | ||
|
|
||
| clickhouse_dialect.add( |
Contributor
There was a problem hiding this comment.
Can we just incorporate BackQuotedIdentifierSegment into the existing clickhouse_dialect.add?
Contributor
Author
There was a problem hiding this comment.
@greg-finley Ah! I thought the ordering was important here. Done and cleaned up the multiple .replace clauses as well
Contributor
There was a problem hiding this comment.
Great, thanks! Yeah it's a bit weird how it compiles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief summary of the change made
Fixes #5356
Fixes #4637
Prior to this change, backquoted identifiers failed to parse when using the Clickhouse Dialect.
Examples as identified in tests.
This became a bigger issue as of the release of dbt-clickhouse v1.6.1 yesterday (2023/12/4), which expands dbt references with backticks.
Are there any other side effects of this change that we should be aware of?
I don't think so
Pull Request checklist
Please confirm you have completed any of the necessary steps below.
Included test cases to demonstrate any code changes, which may be one or more of the following:
.ymlrule test cases intest/fixtures/rules/std_rule_cases..sql/.ymlparser test cases intest/fixtures/dialects(note YML files can be auto generated withtox -e generate-fixture-yml).test/fixtures/linter/autofix.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.