ClickHouse / ClickHouse/ClickHouse
Parameterized CTE
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
### Company or project name
ClickHouse
### Use case
See https://github.com/ClickHouse/sql-mandelbrot-benchmark/blob/clickbrot/clickbrot.py
### Describe the solution you'd like
Similar to parameterized views, we should allow parameterized CTE:
```
WITH t AS (SELECT {v:String}) SELECT * FROM t(v = 'Hello, world!')
```
### Describe alternatives you've considered
_No response_
### Additional context
Question: What is the resolution priority if the parameter is set both with a setting and with the table-function syntax?
I prefer if we first recursively substitute values from table-function invocations, and only when other query parameters remain, consider settings.
Contributor guide
Assessment
This issue has not been assessed yet.