Skip to content

Regenerate explain files with ClickHouse 26.8 LTS - #125

Open
kyleconroy wants to merge 11 commits into
mainfrom
claude/project-thread-8e2oya-bump-26.8
Open

kyleconroy wants to merge 11 commits into
mainfrom
claude/project-thread-8e2oya-bump-26.8

Conversation

@kyleconroy

Copy link
Copy Markdown
Collaborator

Requested by Kyle · project thread

Stacked on #124. Review that first; this PR's base will move to main when it merges.

Summary

Moves the golden EXPLAIN AST files from ClickHouse 25.8.13 LTS to 26.8.51.4 LTS and updates the explainer for the output changes in 26.x.

Tooling

  • cmd/regenerate-explain pins 26.8.51.4 and queries the server over HTTP instead of starting clickhouse client for each statement. A full regeneration now takes about 50 seconds instead of about 2.5 hours.
  • It removes explain files for statements that ClickHouse now rejects as syntax errors, and for statement numbers past the end of query.sql. Other errors, such as invalid setting values, keep the existing file. -v prints why each statement was rejected.
  • New go test ./parser/... -mark-todo flag records failing statements in explain_todo instead of failing. Documented in CLAUDE.md.

Explain changes to match 26.x

  • ENGINE = X() prints like ENGINE = X.
  • Empty arrays print as Literal Array_[], including nested ones.
  • Index TYPE minmax without parentheses prints as a bare function.
  • Query-level SETTINGS print before FORMAT.
  • CREATE INDEX lists the tuple columns, prints TYPE arguments, and keeps the database name.
  • Inline OVER (...) and WINDOW elements print a WindowDefinition with partition, order and frame offsets.
  • TupleDataType, EnumDataType, and types with empty parentheses print the new way.

The regeneration changed 4,344 statements' expected output. After these fixes, 609 remain in explain_todo. The biggest remaining group is secret masking ('[HIDDEN]' literals), which I'll port in a follow-up.

Test Plan

  • go run ./cmd/regenerate-explain against 26.8.51.4, then go test ./parser/... -mark-todo.
  • I checked that the HTTP path produces byte-identical output to clickhouse client on 300 tests.
  • After each explain change, go test ./parser/... -check-explain removed newly passing statements from explain_todo. go test ./... passes with no regressions.

Generated by Claude Code

@kyleconroy kyleconroy self-assigned this Dec 1, 2026
claude added 10 commits December 1, 2026 04:55
Move cmd/regenerate-explain from 25.8.13.73 to 26.8.51.4 LTS and
regenerate every explain file.

- Query the server over HTTP instead of spawning clickhouse client for
  every statement. A full regeneration now takes under a minute.
- Remove explain files for statements that the new version rejects,
  and for statement numbers past the end of query.sql.
- Add a -mark-todo test flag that records failing statements in
  explain_todo instead of failing.

26.8 changed EXPLAIN AST output in many places (EnumDataType,
TupleDataType, engines without arguments, empty array literals, window
definitions, secret masking). The 4,344 statements whose output no
longer matches are marked explain_todo and will be fixed in follow-ups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
ClickHouse 26 prints TYPE minmax without an argument list but keeps it
for TYPE minmax(). Record whether the type had parentheses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
List the columns of a multi-column index in the tuple, print TYPE
arguments and a TYPE without parentheses as a bare function, and keep
the database of db.table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
ClickHouse 26 prints a WindowDefinition child for every OVER (...)
clause and for each WINDOW clause element, with partition, order and
frame offsets. Record whether OVER had parentheses to tell OVER w from
OVER (w).

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
ClickHouse 26.8 rejects some statements while applying their SETTINGS
(e.g. a negative timeout) rather than while parsing them. Keep the
explain files for those, and add -v to print why each statement was
rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
@kyleconroy
kyleconroy changed the base branch from claude/project-thread-8e2oya to main December 1, 2026 04:55
@kyleconroy
kyleconroy force-pushed the claude/project-thread-8e2oya-bump-26.8 branch from 4ab5151 to e9d9843 Compare December 1, 2026 04:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
@kyleconroy
kyleconroy added this pull request to stack #128 December 1, 2026 05:09
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