Skip to content

Update parser for ClickHouse 26.8: ALTER, CREATE, ATTACH and DESCRIBE forms - #136

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

kyleconroy merged 3 commits into
claude/project-thread-8e2oya-syntax-8from
claude/project-thread-8e2oya-syntax-9

Conversation

@kyleconroy

Copy link
Copy Markdown
Collaborator

Requested by Kyle · project thread

Summary

Batch 9 of the ClickHouse 26.8 update. Pending explain_todo statements go from 518 to 409.

  • ALTER: ALTER HANDLER, EXECUTE cmd(args), MODIFY CONSTRAINT, ALTER COLUMN ... TYPE, DROP DETACHED PART, MOVE PART, DELETE IN PARTITION, CLEAR COLUMN IF EXISTS.
  • Columns: AUTO_INCREMENT, TTL or PRIMARY KEY without a type, keyword-named tuple elements such as Tuple(array Array(UInt32)).
  • CREATE: CREATE HYPOTHETICAL INDEX; refresh strategies with DEPENDS ON, SETTINGS, TO INNER UUID and EMPTY; SQL SECURITY on tables; RECENT SAMPLES ENGINE for TimeSeries; nested key-value lists in dictionary sources (headers(header(name ... value ...))); query parameters as database names in FROM; SETTINGS inside CREATE TABLE AS func(...).
  • ATTACH: ATTACH TABLE and ATTACH MATERIALIZED VIEW now use the CREATE parser and print as AttachQuery, which picks up every CREATE clause.
  • DESCRIBE: bare and unioned queries, table names starting with digits, SETTINGS before FORMAT, TEMPORARY TABLE.
  • Other: set operations inside IN ((SELECT ...) UNION ...), trim(BOTH ... FROM ...) in codec, index and statistics type slots, viewIfPermitted(... ELSE ...), DETACH TEMPORARY TABLE, REPLACE TEMPORARY TABLE.

Test Plan

  • go test ./parser/... -timeout 60s passes.
  • go test ./parser/... -check-explain removed the newly passing statements from explain_todo.
  • Spot-checked each new form against a local ClickHouse 26.8 server with EXPLAIN AST.

Generated by Claude Code

Adds ALTER HANDLER, ALTER ... EXECUTE cmd(args), MODIFY CONSTRAINT,
ALTER COLUMN ... TYPE, DROP DETACHED PART, MOVE PART, DELETE IN
PARTITION, CLEAR COLUMN IF EXISTS, AUTO_INCREMENT, column TTL without a
type, set operations inside IN (...), and trim(...) in codec, index and
statistics type slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
CREATE HYPOTHETICAL INDEX, refresh strategy DEPENDS ON/SETTINGS, TO INNER
UUID, EMPTY after view storage, SQL SECURITY on tables, RECENT SAMPLES
ENGINE for TimeSeries, nested key-value lists in dictionary sources,
query parameters as database names in FROM, keyword-named tuple elements
and SETTINGS in CREATE TABLE AS table functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KB7DMX365Nmn5ksnY
…forms

ATTACH TABLE and ATTACH MATERIALIZED VIEW now use the CREATE parser and
print as AttachQuery. DESCRIBE accepts bare and unioned queries, table
names starting with digits and SETTINGS before FORMAT. Also adds
viewIfPermitted(... ELSE ...), DETACH TEMPORARY TABLE [IF EXISTS] and
REPLACE TEMPORARY TABLE.

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 07:00
@kyleconroy
kyleconroy merged commit 81c15f2 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