Skip to content

feat: [clickhouse] native binary protocol + parser + grafana v4 plugin#981

Open
crandles wants to merge 10 commits into
trickstercache:mainfrom
crandles:clickhouse-binary
Open

feat: [clickhouse] native binary protocol + parser + grafana v4 plugin#981
crandles wants to merge 10 commits into
trickstercache:mainfrom
crandles:clickhouse-binary

Conversation

@crandles
Copy link
Copy Markdown
Contributor

@crandles crandles commented Apr 18, 2026

Description

  • ClickHouse native binary protocol both directions: frontend protocol_listeners (raw TCP, extensible to MySQL) and backend protocol: native upstream via clickhouse-go
  • Native DPC modeler: detects Native via X-ClickHouse-Format, deserializes for caching and delta-merging, re-serializes for response — no client config needed
  • Fetcher abstraction in PrepareFetchReader opens non-HTTP upstreams more generally
  • Wire protocol coverage: handshake + addendum, query, data blocks, ping/pong, LZ4. INSERT-as-SQL works; inline INSERT data blocks not yet supported
  • Parser: 17 toStartOf* functions, date_trunc, timeSlot, toStartOfInterval with all units; toDateTime64(value, precision) and now64() in WHERE; Date-type interpolation for toStartOfMonth/Quarter/Year (Grafana v4+ shapes)
  • DPC→OPC fallback warns at warn level, togglable via dpc_fallback_warning; structural non-TS queries (health checks, version) stay at debug
  • Dev env: both Vertamedia and official Grafana plugins installed, dashboard for each
  • CI: skip CodeQL on forks

Type of Change

    • New feature
    • Test coverage
    • Documentation
    • Infrastructure

AI Disclosure

    • This contribution DOES include AI-generated changes, and I have reviewed the relevant contributing guidelines.

Signed-off-by: Chris Randles <randles.chris@gmail.com>
Signed-off-by: Chris Randles <randles.chris@gmail.com>
…ClickHouse plugin

Signed-off-by: Chris Randles <randles.chris@gmail.com>
Signed-off-by: Chris Randles <randles.chris@gmail.com>
@crandles crandles force-pushed the clickhouse-binary branch from 64c1502 to 9b1f828 Compare April 18, 2026 14:56
@crandles crandles changed the title feat: ClickHouse native binary protocol support feat: ClickHouse native protocol + complete feature coverage Apr 18, 2026
@crandles crandles marked this pull request as ready for review April 18, 2026 16:18
@crandles crandles requested a review from a team as a code owner April 18, 2026 16:18
@crandles
Copy link
Copy Markdown
Contributor Author

crandles commented Apr 18, 2026

This is admittedly the most I've used clickhouse for some time. Going TDD here, may have missed something obvious.

…lback_warning + protocol_listeners

Signed-off-by: Chris Randles <randles.chris@gmail.com>
@crandles crandles changed the title feat: ClickHouse native protocol + complete feature coverage feat: [clickhouse] native binary protocol + parser + grafana v4 plugin Apr 20, 2026
Signed-off-by: Chris Randles <randles.chris@gmail.com>
Comment thread pkg/backends/clickhouse/native/client.go Fixed
@crandles
Copy link
Copy Markdown
Contributor Author

crandles commented Apr 20, 2026

Test failure appears on main, seems time dependent (#986)

Signed-off-by: Chris Randles <randles.chris@gmail.com>
Signed-off-by: Chris Randles <randles.chris@gmail.com>
Signed-off-by: Chris Randles <randles.chris@gmail.com>
@crandles
Copy link
Copy Markdown
Contributor Author

Working locally, just hunting for bugs at this point.

Signed-off-by: Chris Randles <randles.chris@gmail.com>
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