Parse Clickhouse quantiles function
Search before asking
- [X] I searched the issues and found no similar issues.
Description
I expect that this query are correct
SELECT quantiles(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99, 0.999)(click) AS quantiles_click_size
FROM clickhouse_table
but I receive error
sqlfluff lint query.sql --dialect clickhouse
== [query.sql] FAIL
L: 1 | P: 75 | PRS | Line 1, Position 75: Found unparsable section: '(click)
| AS quantiles_click_size'
WARNING: Parsing errors found and dialect is set to 'clickhouse'. Have you configured your dialect correctly?
My configuration
[sqlfluff]
verbose = 0
max_line_length = 88
[sqlfluff:rules:capitalisation.functions]
extended_capitalisation_policy = upper
ignore_words = multiIf,match,quantiles,countIf,uniqExact
Use case
No response
Dialect
clickhouse
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
- [X] I agree to follow this project's Code of Conduct
It seems the quantiles function isn't being correctly parsed in the ClickHouse dialect. Consider checking if the dialect configuration supports the specific function syntax or if updates to the dialect are required to handle nested function calls like this.
It seems the
quantilesfunction isn't being correctly parsed in the ClickHouse dialect. Consider checking if the dialect configuration supports the specific function syntax or if updates to the dialect are required to handle nested function calls like this.
where would I check that? I cannot see the functions neither in dialect_clickhouse.py not dialect_clickhouse_keywords.py, we encountered a very similar problem with the multiIf function.
I opened a PR to fix this issue: https://github.com/sqlfluff/sqlfluff/pull/7205