Skip to content

Clickhouse Dialect does not support backticks as identifier quotes #4637

@phantom943

Description

@phantom943

Search before asking

  • I searched the issues and found no similar issues.

What Happened

Running the lint command on the query

select `num`.`number` as nn
from system.numbers as `num`
limit 2

This returns

/* Lint errors:
L1 P1 PRS: Line 1, Position 1: Found unparsable section: 'select `num`.`number` as nn'
L2 P21 PRS: Line 2, Position 21: Found unparsable section: 'as `num`'
*/

The issue is with the backticks, because without those the lint runs OK:

select num.number as nn
from system.numbers as num
limit 2

Expected Behaviour

It should not display unparsable sections.

Observed Behaviour

Displays unparsable sections

How to reproduce

sqlfluff lint <file.sql>

Dialect

Clickhouse

Version

2.0.2

Configuration

[sqlfluff]
exclude_rules = L022,L030,L031
max_line_length = 80

[sqlfluff:rules]
allow_scalar = True
single_table_references = consistent
unquoted_identifiers_policy = all

[sqlfluff:indentation]
indent_unit = space
tab_space_size = 4

[sqlfluff:layout:type:where_clause]
line_position = leading

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclickhouseIssues relating to the Clickhouse dialect

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions