Skip to content

[BUG] 5.4-SNAPSHOT : ClickHouse : asterisk column modifiers fail or mis-parse (APPLY as alias, docs chain, STRICT, EXCEPT regex) #2636

Description

@fudianchn

AI disclosure: this issue was prepared with AI coding agents, revised and verified by me.

Failing SQL Feature:

ClickHouse column modifiers on * / t.*: the documented APPLY modifier is silently mis-parsed as a select-item alias, the documented modifier chain from the SELECT docs fails with a ParseException, and the STRICT variants plus the regex-string form of EXCEPT (implemented in the ClickHouse grammar, covered by its stateless tests) are unsupported.

SQL Example:

-- 1) documented in the ClickHouse SELECT docs, mis-parsed on master:
--    parses as AllColumns with alias "APPLY(sum)"
SELECT * APPLY(sum) FROM t;

-- 2) the modifier chain exactly as shown in the ClickHouse docs, fails:
SELECT * REPLACE(i + 1 AS i) EXCEPT (j) APPLY(sum) FROM columns_transformers;

-- 3) STRICT variants (undocumented, but in the ClickHouse grammar and
--    its stateless tests) and the regex form of EXCEPT, all fail:
SELECT * EXCEPT STRICT (a, b) FROM t;
SELECT * REPLACE STRICT (1 AS a, 2 AS b) FROM t;
SELECT * EXCEPT '^tmp_' FROM t;

Baseline that already parses: SELECT * EXCEPT (a, b) FROM t, SELECT * REPLACE (a AS b) FROM t, SELECT * EXCLUDE (a) FROM t.

Software Information:

  • JSqlParser version: current master 5.4-SNAPSHOT, commit 02b9d94 (tested 2026-09-14)
  • Database: ClickHouse

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions