Skip to content

feat(ext): add ClickHouse support #454

Description

@timveil

Companion to #445 (new database support). Highest effort / most caveats of the candidates — filed for completeness; recommend tackling after the embedded DBs.

Why

ClickHouse is the leading open-source (Apache 2.0) OLAP/columnar database, very widely adopted for analytics. Driver: com.clickhouse:clickhouse-jdbc. Container: org.testcontainers:clickhouse.

Architectural mismatch to resolve first

ClickHouse is not a constraint-enforcing OLTP store, which collides with several of Bloviate's assumptions:

  • No FK / PK uniqueness enforcement (MergeTree ORDER BY is not a unique key). Bloviate's FK dependency-graph fill still runs, but there are effectively no FKs to order and no uniqueness guarantees — decide what "filling" means here.
  • Insert/engine semantics differ (MergeTree, large batch inserts, optional async inserts). Validate that the addBatch/executeBatch path in TableFiller works well and tune batch sizing.
  • Nullability is explicit via Nullable(T), and LowCardinality(T) wraps another type — both complicate type-name dispatch.

Scope — new dialect (own support + several new generators)

  • ClickHouseSupport extends AbstractDatabaseSupport; empirical DATA_TYPE/TYPE_NAME discovery first (per feat(ext): full PostgreSQL and MySQL vendor-type support #444) — ClickHouse type names are distinctive.
  • Types: UInt8/16/32/64, Int8…Int64, Float32/64, Decimal, String, FixedString(N), Date/Date32/DateTime/DateTime64, UUID, Enum8/16, Array(T), Nullable(T), LowCardinality(T), Map, Tuple, IPv4/IPv6. Reuse UUIDGenerator/InetGenerator/array generators where possible; new generators likely needed for unsigned ints, FixedString, and the wrapper types.
  • forProduct: add a clickhouse branch + selection test.
  • create_tables.clickhouse.sql (MergeTree tables) + fillTestTables.
  • Driver: com.clickhouse:clickhouse-jdbc (test scope).

Acceptance criteria

  • Decision recorded on how FK-less / non-unique semantics map to Bloviate's fill model
  • ClickHouseSupport registered and selectable
  • Integration test fills a representative MergeTree schema (incl. Nullable/LowCardinality/Array) cleanly
  • Unsupported types throw rather than generate invalid data
  • README "Database Support" table updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions