Skip to content

The ClickHouse edge answers in the formats HyperDX asks for: JSONCompactEachRowWithNamesAndTypes, TabSeparatedRaw, ISO timestamps, and count() by its name (T-493) - #351

Merged
chasers merged 1 commit into
sql-lexer-to-corefrom
t-493-clickhouse-hyperdx-formats
Sep 20, 2026
Merged

chasers merged 1 commit into
sql-lexer-to-corefrom
t-493-clickhouse-hyperdx-formats

Conversation

@chasers

@chasers chasers commented Sep 20, 2026

Copy link
Copy Markdown
Owner

TL;DR: The ClickHouse edge answers in the formats HyperDX asks for, writes ISO timestamps on request, and names count() as ClickHouse does.

Tracker: T-493. Plan PL-66. Stacked on #350 (T-502).

Why

  • HyperDX streams its results table from JSONCompactEachRowWithNamesAndTypes.
  • It sends date_time_output_format=iso on every query and feeds the values to new Date().
  • It reads its total from a column named exactly count(). DuckDB names it count_star().

What changed

  • New formats: JSONCompactEachRow, ...WithNames, ...WithNamesAndTypes, TabSeparatedRaw.
  • Format.encode/4 takes opts: elapsed_ms: and date_time: :iso.
  • An unaliased count() or count(*) answers as count().

How it works

Setting Timestamp in a text format
none 2026-09-19 10:11:29.500000
date_time_output_format=iso 2026-09-19T10:11:29.500000Z
  • RowBinary carries the same number either way.

Watch out

  • ⚠️ The body is still built whole, not streamed. HyperDX works without chunking.

Checks

  • mix precommit
  • mix ci

🤖 Generated with Claude Code

…actEachRowWithNamesAndTypes, TabSeparatedRaw, ISO timestamps, and count() by its name (T-493)

HyperDX streams its results table from JSONCompactEachRowWithNamesAndTypes,
sends date_time_output_format=iso on every query and feeds the values to
new Date(), and reads its total from a column named exactly count().

- Format takes the JSONCompactEachRow family (plain, WithNames,
  WithNamesAndTypes) and TabSeparatedRaw, which writes a value unescaped.
- Format.encode/4 takes opts: elapsed_ms: and date_time: :iso, which writes
  a timestamp as 2026-09-19T10:11:29.500000Z in the text formats. RowBinary
  carries the number either way. Query reads the setting from the URL.
- An unaliased count() or count(*) answers as count(), not the engine's
  count_star().

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chasers
chasers force-pushed the t-493-clickhouse-hyperdx-formats branch from 6f6f9de to afe30cc Compare September 20, 2026 03:11
@chasers
chasers merged commit e258049 into main Sep 20, 2026
11 of 12 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.

1 participant