Skip to content

Add ClickHouse read/write nodes to the SQL graph - #79

Open
Marais wants to merge 1 commit into
dataflint:mainfrom
Marais:clickhouse-write-read-node
Open

Add ClickHouse read/write nodes to the SQL graph#79
Marais wants to merge 1 commit into
dataflint:mainfrom
Marais:clickhouse-write-read-node

Conversation

@Marais

@Marais Marais commented Jul 10, 2026

Copy link
Copy Markdown

What

image image

Recognise the ClickHouse Spark connector in the query plan and give its nodes first-class treatment in the DataFlint SQL view.

Writes

An AppendData whose plan references ClickHouseWrite is renamed "ClickHouse Write" and surfaces the connector's write metrics. The verbose per-batch metrics are collapsed into compact array-style rows so they fit on the node:

Row Example Meaning
Batch Fill (0-25/25-50/50-75/75-100%) [1, 0, 0, 0] batches bucketed by how full they were vs. the configured batch size
Batch Size (min/avg/max) [50, 50, 50] rows per batch; avg is derived as rows / batch writes
Batch Writes (ok/failed) [1, 0] successful vs. failed batch writes

Reads

A BatchScan backed by ClickHouseBatchScan is renamed "ClickHouse Read". These were previously misdetected as Iceberg reads — a ClickHouse read looks identical to an Iceberg scan by node name (BatchScan \db`.`table``); the scan class in the plan description is what disambiguates them.

Casing fix

capitalizeWords now preserves mixed-case brand/acronym words, so node names render as ClickHouse / BigQuery / HDFS instead of the previous Clickhouse / Bigquery / Hdfs.

How it's detected

Mirrors the existing Iceberg/BigQuery detection: match a marker string in the node's plan description (ClickHouseWrite / ClickHouseBatchScan) and set a parsed-plan flag consumed by nodeEnrichedNameBuilder.

Tests

spark-ui unit tests pass (104/104), including new cases for the write parser, the read scan parser, node naming, and metric filtering. Typecheck and production build are clean.

🤖 Generated with Claude Code

Recognise the ClickHouse Spark connector in the query plan and give its
nodes first-class treatment in the DataFlint SQL view:

- Writes: an AppendData whose plan references ClickHouseWrite is renamed
  "ClickHouse Write" and surfaces the connector's write metrics.
- Reads: a BatchScan backed by ClickHouseBatchScan is renamed
  "ClickHouse Read". Previously these were misdetected as Iceberg reads,
  since they look identical by node name; the scan class in the plan
  description disambiguates them.
- The verbose per-batch write metrics are collapsed into compact
  array-style rows so they fit on the node:
    Batch Fill (0-25/25-50/50-75/75-100%): [a, b, c, d]
    Batch Size (min/avg/max):              [min, avg, max]  (avg = rows / batch writes)
    Batch Writes (ok/failed):              [ok, failed]
- capitalizeWords now preserves mixed-case brand/acronym words, so node
  names render as "ClickHouse"/"BigQuery"/"HDFS" instead of
  "Clickhouse"/"Bigquery"/"Hdfs".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Jul 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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