FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix should allow END as a bare column name by erezrokah · Pull Request #301 · AfterShip/clickhouse-sql-parser · GitHub

Fix should allow END as a bare column name - #301

Merged
git-hulk merged 1 commit into
AfterShip:masterfrom
erezrokah:claude/end-not-reserved
Aug 4, 2026
Merged

Fix should allow END as a bare column name#301
git-hulk merged 1 commit into
AfterShip:masterfrom
erezrokah:claude/end-not-reserved

Conversation

erezrokah commented Aug 3, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Make END non-reserved again so columns named end parse, since ClickHouse does not reserve it.

END joined reservedKeywords in #282, which broke end as a bare column name everywhere except the few lookahead-disambiguated positions:

  • SELECT max(end) FROM t (function arguments)
  • SELECT * FROM t WHERE end > start (expressions)
  • INSERT INTO t (end) VALUES (1)
  • CREATE TABLE t (end DateTime) ENGINE=Memory

SELECT end FROM t, GROUP BY end and ORDER BY end already worked, which made the breakage look partial.

CASE is unaffected: parseColumnCaseExpr expects the END keyword explicitly, so CASE WHEN a THEN 1 ELSE 2 FROM t still errors (covered by a new test) — same as ClickHouse, which reports a syntax error for it.

All of the above statements were verified against clickhouse local 26.7.1 (Docker clickhouse/clickhouse-server:latest).

Tests: cases added to TestNonReservedKeywordAsIdentifier, new TestCaseExprRequiresEnd, and fixture parser/testdata/query/select_end_as_column_name.sql with regenerated goldens.

END is not reserved in ClickHouse; columns named `end` (e.g. CloudQuery's aws_ec2_reserved_instances) failed to parse in function arguments, WHERE, INSERT column lists and CREATE TABLE since it joined reservedKeywords. CASE still requires END because parseColumnCaseExpr expects it explicitly.
erezrokah marked this pull request as ready for review August 3, 2026 15:52
git-hulk changed the title fix: Allow END as a bare column name Fix should allow END as a bare column name Aug 4, 2026

git-hulk commented Aug 4, 2026

Copy link
Copy Markdown
Member

@erezrokah Thanks for your fix.

git-hulk merged commit b156965 into AfterShip:master Aug 4, 2026
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL