ClickHouse / ClickHouse/ClickHouse
clickhouse format --comment lost all comments
Open
comp-sql-syntax
external
unexpected behaviour
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 20h 33m
- Merged PRs (30d)
- 501
Description
### Company or project name
_No response_
### Describe the unexpected behaviour
clickhouse-format drop all comments
### Which ClickHouse versions are affected?
25.8.7.3
### How to reproduce
```
$ chc --version
ClickHouse client version 25.8.7.3 (official build).
$ cat /tmp/q.sql
/* comment 1 */
-- comment 2
SELECT version();
/* comment 3 */
-- comment 4
SELECT version()
/* comment 5 */
-- comment 6
$ cat /tmp/q.sql | clickhouse-format --comments -n
SELECT version();
SELECT version();
```
### Expected behavior
Comments should remain
### Error message and/or stacktrace
N/A
### Additional context
Related to 62256
Contributor guide
Assessment
This issue has not been assessed yet.