Blog

Where does my query end and the echo begin?

The interactive client can echo your query back reformatted, and the two blur together. I asked for a separator; --echo-query-separator shipped in 26.7.

Source: github.com

The client can echo your statement back after normalizing it with the server’s formatter: parentheses around set-operation arms, INTERVAL 1 MINUTE rewritten as toIntervalMinute(1). That echo is useful, but it appears directly under what you typed, in the same font, and in a scrollback of long queries the two blur into one block of SQL. I asked for a visible separator line between them and said the exact shape did not matter.

It took five months. A contributor’s PR #108888, “Add separator between user query and formatted query”, merged on 2026-07-02 and is in 26.7. The design differs from what I sketched, for the better: there is no fixed separator. The client and clickhouse-local got an option you set yourself:

clickhouse client --echo-formatted --echo-query-separator='-- ---- --'

Per the PR description, the string is printed before the formatted echo, it is empty by default so existing output does not change, and it only applies with --echo-formatted.

I could not run it here, since 26.4 predates the release; the behavior above comes from the PR. An empty default plus an option beats one separator for everybody, because people have strong feelings about what a separator should look like.

feature-requestclientusability

Discussion

Comments live in GitHub Discussions. Sign in with GitHub to join in.