ClickHouse / ClickHouse/ClickHouse

Parameterized CTE

Open
#106,659 2 comments 0 reactions 1 assignee Claimed by @adityaksolves View on GitHub
comp-query-analyzer feature warmup task
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.