Skip to content

dialect(clickhouse): version checks and fixes, tested on ClickHouse in Docker - #102

Merged
stbischof merged 1 commit into
eclipse-daanse:mainfrom
dbulahov:main251126_1
Nov 25, 2026
Merged

stbischof merged 1 commit into
eclipse-daanse:mainfrom
dbulahov:main251126_1

Conversation

@dbulahov

Copy link
Copy Markdown
Contributor

What does this PR do?

Checked on clickhouse/clickhouse-server 21.3 to 26.6 in Docker; images
before 21.3 are published only as yandex/clickhouse-server and are not
used.

DdlGenerator (dialect api):

  • supportsMaterializedViews: a refreshable ClickHouse materialized view (24.10) keeps the result of its query; the classic one does not

ClickHouseDialect:

  • generateListAgg: arrayStringConcat over the group's rows, sorted per key, stable, DESC and NULLS FIRST/LAST kept, DISTINCT, any separator; groupArrayArray, written before, takes arrays only and failed with Code 43 on every version
  • generateNthValueAgg, supportsNthValue, supportsNthValueIgnoreNulls: the n-th of the group's sorted rows, NULL past the end; were refused
  • generatePercentileDisc/Cont, supportsPercentileDisc/Cont: computed on the sorted group; no quantile gives the discrete one, and 21.x's quantileExactInclusive gives the 2nd value for p = 1
  • paginationGenerator: LIMIT n OFFSET m; OFFSET ... FETCH failed without ORDER BY on every version (Code 628), FETCH alone on 21.x
  • castGenerator: ClickHouse type names; supportsTryCast, tryCast as accurateCastOrNull, a boolean before 24.3 as true/false/1/0, else NULL (22.x and 23.x threw on what is no boolean)
  • allowsRegularExpressionInWhereClause, generateRegularExpression: match(s, '(?-s)\A(?:...)\z') on RE2; none for lookaround, back references, possessive, class intersection, which RE2 refuses or reads otherwise; Java's u flag taken out
  • supportsGroupingSets: from 22.9; 22.6 leaves the rows unsorted, 22.6 to 22.8 give GROUPING() the other way round
  • cteGenerator: RECURSIVE from 24.4, on the new analyzer only
  • supportsRenameColumn: from 20.4
  • supportsUsers, supportsRoles: from 20.4; createUser gives no user where supportsUsers says no
  • commentOnTable: MODIFY COMMENT from 21.11; supportsCommentOnView, a view's comment and its columns' from 22.1, 21.11 and 21.12 write metadata they cannot read again and the server does not start
  • supportsAtomicMultiRenameTable: false, RENAME TABLE a TO b, c TO d undoes nothing when a later rename fails; renameTables writes one statement per rename
  • supportsCreateOrReplaceView: stays false, documented: ClickHouse's OR REPLACE replaces a table too, its rows gone
  • supportsMaterializedViews: from 24.10, REFRESH AFTER 10 YEAR, a refresh on demand in effect; dropped with DROP VIEW
  • unionDistinctKeyword: UNION DISTINCT from 21.1, documented

Container tests, the dialect built from a live connection:

  • ClickHouseContainers: the image of a tag, the driver's V1 before 21.11, which sends no async_insert
  • ClickHouseListAggTest, ClickHouseNthValueTest, ClickHousePercentileTest, ClickHouseOffsetTest, ClickHouseTryCastTest, ClickHouseRegularExpressionTest (rows as Java's Pattern.matches), ClickHouseGroupingSetsTest, ClickHouseRecursiveCteTest, ClickHouseUnionDistinctTest, ClickHouseRenameColumnTest, ClickHouseUsersTest, ClickHouseRolesTest, ClickHouseCommentOnTableTest, ClickHouseCommentOnColumnTest, ClickHouseAtomicMultiRenameTableTest, ClickHouseCreateOrReplaceViewTest, ClickHouseMaterializedViewTest
  • ClickHouseDialectTest, ClickHouseAlterRenameOfflineTest, ViewCommentStatementsTest, MaterializedViewStatementsTest: the new statements and flags

…n Docker

  Checked on clickhouse/clickhouse-server 21.3 to 26.6 in Docker; images
  before 21.3 are published only as yandex/clickhouse-server and are not
  used.

  DdlGenerator (dialect api):
  - supportsMaterializedViews: a refreshable ClickHouse materialized view
    (24.10) keeps the result of its query; the classic one does not

  ClickHouseDialect:
  - generateListAgg: arrayStringConcat over the group's rows, sorted per
    key, stable, DESC and NULLS FIRST/LAST kept, DISTINCT, any separator;
    groupArrayArray, written before, takes arrays only and failed with
    Code 43 on every version
  - generateNthValueAgg, supportsNthValue, supportsNthValueIgnoreNulls:
    the n-th of the group's sorted rows, NULL past the end; were refused
  - generatePercentileDisc/Cont, supportsPercentileDisc/Cont: computed on
    the sorted group; no quantile gives the discrete one, and 21.x's
    quantileExactInclusive gives the 2nd value for p = 1
  - paginationGenerator: LIMIT n OFFSET m; OFFSET ... FETCH failed
    without ORDER BY on every version (Code 628), FETCH alone on 21.x
  - castGenerator: ClickHouse type names; supportsTryCast, tryCast as
    accurateCastOrNull, a boolean before 24.3 as true/false/1/0, else
    NULL (22.x and 23.x threw on what is no boolean)
  - allowsRegularExpressionInWhereClause, generateRegularExpression:
    match(s, '(?-s)\A(?:...)\z') on RE2; none for lookaround, back
    references, possessive, class intersection, which RE2 refuses or
    reads otherwise; Java's u flag taken out
  - supportsGroupingSets: from 22.9; 22.6 leaves the rows unsorted,
    22.6 to 22.8 give GROUPING() the other way round
  - cteGenerator: RECURSIVE from 24.4, on the new analyzer only
  - supportsRenameColumn: from 20.4
  - supportsUsers, supportsRoles: from 20.4; createUser gives no user
    where supportsUsers says no
  - commentOnTable: MODIFY COMMENT from 21.11; supportsCommentOnView,
    a view's comment and its columns' from 22.1, 21.11 and 21.12 write
    metadata they cannot read again and the server does not start
  - supportsAtomicMultiRenameTable: false, RENAME TABLE a TO b, c TO d
    undoes nothing when a later rename fails; renameTables writes one
    statement per rename
  - supportsCreateOrReplaceView: stays false, documented: ClickHouse's
    OR REPLACE replaces a table too, its rows gone
  - supportsMaterializedViews: from 24.10, REFRESH AFTER 10 YEAR, a
    refresh on demand in effect; dropped with DROP VIEW
  - unionDistinctKeyword: UNION DISTINCT from 21.1, documented

  Container tests, the dialect built from a live connection:
  - ClickHouseContainers: the image of a tag, the driver's V1 before
    21.11, which sends no async_insert
  - ClickHouseListAggTest, ClickHouseNthValueTest,
    ClickHousePercentileTest, ClickHouseOffsetTest, ClickHouseTryCastTest,
    ClickHouseRegularExpressionTest (rows as Java's Pattern.matches),
    ClickHouseGroupingSetsTest, ClickHouseRecursiveCteTest,
    ClickHouseUnionDistinctTest, ClickHouseRenameColumnTest,
    ClickHouseUsersTest, ClickHouseRolesTest, ClickHouseCommentOnTableTest,
    ClickHouseCommentOnColumnTest, ClickHouseAtomicMultiRenameTableTest,
    ClickHouseCreateOrReplaceViewTest, ClickHouseMaterializedViewTest
  - ClickHouseDialectTest, ClickHouseAlterRenameOfflineTest,
    ViewCommentStatementsTest, MaterializedViewStatementsTest: the new
    statements and flags

Signed-off-by: <bulahovdenis@gmail.com>
@stbischof
stbischof merged commit 033e5ac into eclipse-daanse:main Nov 25, 2026
30 checks 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