GeezerVison is showing github.com — [BUG] JSQLParser 5.4-SNAPSHOT : Clickhouse : ORDER BY after CREATE TABLE unsupported · Issue #2353 · JSQLParser/JSqlParser
[BUG] JSQLParser 5.4-SNAPSHOT : Clickhouse : ORDER BY after CREATE TABLE unsupported #2353
Description
The parser doesn't support an ORDER BY statement after a CREATE TABLE, which is usually used to define the physical sort order of the table.
This capability is supported in latest Clickhouse.
Sample query:
CREATE TABLE metrics (
event_date Date,
user_id UInt64,
value Float64
) ENGINE = MergeTree()
ORDER BY (event_date, user_id);
Error: ParseException: Encountered: <K_ORDER> / "ORDER", at line 6, column 1, in lexical
Activity
fudianchn commented on Aug 17, 2026
Verified on current master f41c0b8: the statement from this issue parses and round-trips.
CCJSqlParserUtil.parse("CREATE TABLE metrics (\n"
+ " event_date Date,\n user_id UInt64,\n value Float64\n"
+ ") ENGINE = MergeTree()\n"
+ "ORDER BY (event_date, user_id)");
// => parses, toString() round-trips
The issue was reported against an older 5.4-SNAPSHOT; current master appears to have this fixed, so this can be closed.
manticore-projects commented on Aug 17, 2026
minleejae commented on Sep 4, 2026
@manticore-projects This was fixed by #2377, and the original SQL now parses and round-trips on the current master. Could you please close this issue?
Reacted by manticore-projects
Metadata
Metadata
Development
No branches or pull requestsIssue actions