Skip to content

Update explain output for ClickHouse 26.8 (batch 8: casts, statistics, regex operators, joins) - #135

Merged
kyleconroy merged 4 commits into
claude/project-thread-8e2oya-syntax-7from
claude/project-thread-8e2oya-syntax-8
Dec 1, 2026
Merged

kyleconroy merged 4 commits into
claude/project-thread-8e2oya-syntax-7from
claude/project-thread-8e2oya-syntax-8

Conversation

@kyleconroy

Copy link
Copy Markdown
Collaborator

Requested by Kyle · project thread

Summary

Batch 8 of the ClickHouse 26.8 explain work. Pending explain_todo statements: 958 → 518.

  • Explain printing is now serialized. The printer keeps context in package variables, and TestParser runs in parallel, so some outputs were flaky. A mutex in Explain/ExplainStatements fixes this; about 140 statements started passing with it.
  • x::T operands follow ParserCastOperator. Only numbers, strings and brackets stay as source text. One-element tuples (x,) and words like nan/NULL are parsed as normal expressions.
  • EPHEMERAL: defaultValueOfTypeName('<type>') now takes an argument, the column type may be omitted, and any expression may follow (including CODEC(...)).
  • Statistics: MATERIALIZE/CLEAR STATISTICS ALL and bare statistics types such as TYPE basic.
  • Storage: CreateSQLFunctionQuery naming, ORDER BY (a DESC, ...) wraps every key, and query-level settings are dropped from a MergeTree/Log/Memory/Null/Kafka SETTINGS clause (list generated from system.settings minus system.merge_tree_settings).
  • New syntax:
    • LIMIT n BY ALL
    • The regex operators ~ ~* !~ !~*, including with SOME/ALL
    • Parenthesized join lists FROM (t1 JOIN t2 ON ...)
    • trim(s, chars), plus trim(...) as a table function
    • eval(SELECT ...)
    • DELETE FROM db.t
    • WITH x AS a, SELECT (trailing comma)
    • settings as a column name
    • An arm's own WITH now merges with the WITH inherited from the first union arm
  • Trim: trim(... '' FROM s) is no longer simplified away, matching 26.x.

Test Plan

  • go test ./parser/... ./lexer/... -timeout 30s passes.
  • go test ./parser/... -check-explain was run, and the updated metadata.json files are included.
  • New syntax was spot-checked against a local ClickHouse 26.8.51.4 server with EXPLAIN AST.

Generated by Claude Code

… explain printing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
…BY DESC, drop query settings from engine SETTINGS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
…ELETE db.table, WITH trailing comma

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
@kyleconroy kyleconroy self-assigned this Dec 1, 2026
@kyleconroy
kyleconroy added this pull request to stack #128 December 1, 2026 06:44
@kyleconroy
kyleconroy merged commit 09a1b9c into main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants