You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UI generates invalid ClickHouse queries when filtering on parsed JSON strings #995
HyperDX UI automatically parses JSON strings in the StatusMessage column but fails to generate proper ClickHouse queries when users attempt to filter on nested JSON fields through the Search for this value only feature.
Steps to Reproduce
Have a span with a StatusMessage field (stored as a String in ClickHouse) containing JSON data.
In the HyperDX UI, the string is automatically parsed as JSON and displayed in a tree structure:
Navigate to the nested field (e.g., failures.0.index with value "identities")
Click Search for this value only:
Expected Behavior
The UI should generate a valid ClickHouse query using proper JSON Functions such as:
simpleJSONExtractString(StatusMessage, 'index') = 'identities' for field matching
Actual Behavior
HyperDX generates an invalid query that fails with a ClickHouse syntax error. The UI knows how to parse and display the JSON structure correctly but cannot translate user filtering actions into proper ClickHouse queries.
Suggested Fix
The UI should:
Detect when a field is a JSON string that has been automatically parsed
Prefer simpleJSONExtractString for basic field matching as it's more reliable for nested JSON
Fall back to JSONExtractString only when precise path specification is required
Impact
This significantly impacts usability as users cannot effectively filter on JSON data through the UI, forcing them to write raw ClickHouse queries manually.
changed the title [-]UI generates invalid ClickHouse queries when filtering on nested JSON fields[/-][+]UI generates invalid ClickHouse queries when filtering on parsed JSON fields[/+]on Jul 12, 2025
changed the title [-]UI generates invalid ClickHouse queries when filtering on parsed JSON fields[/-][+]UI generates invalid ClickHouse queries when filtering on parsed JSON strings[/+]on Jul 12, 2025
Seems like this was fixed by #1213, but it still is broken for nested JSON inside JSON columns.
To reproduce
Enable self ingestion on the hyperdx instance and search for StatusCode = 'Error'
Find a JSONColumn that has nested JSON (as string). I picked SpanAttributes that has db.statement containing JSON in it.
Notice that the query sent contains JSONExtractString(db.statement, 'create') and completely omits the actual column name.
Video:
CleanShot.2025-10-21.at.00.11.52.mp4
To fix
The below patch seems to fix the issue for all such JSON columns. The query is now correctly sent as JSONExtractString(SpanAttributes['db.statement'], 'create')
Activity
[-]UI generates invalid ClickHouse queries when filtering on nested JSON fields[/-][+]UI generates invalid ClickHouse queries when filtering on parsed JSON fields[/+][-]UI generates invalid ClickHouse queries when filtering on parsed JSON fields[/-][+]UI generates invalid ClickHouse queries when filtering on parsed JSON strings[/+]teeohhem commentedon Jul 15, 2025
Thanks for the report! I've logged an issue with the team. Reference: HDX-2017
fleon commentedon Oct 20, 2025
Seems like this was fixed by #1213, but it still is broken for nested JSON inside JSON columns.
To reproduce
StatusCode = 'Error'SpanAttributesthat hasdb.statementcontaining JSON in it.JSONExtractString(db.statement, 'create')and completely omits the actual column name.Video:
CleanShot.2025-10-21.at.00.11.52.mp4
To fix
The below patch seems to fix the issue for all such JSON columns. The query is now correctly sent as
JSONExtractString(SpanAttributes['db.statement'], 'create')Video:
CleanShot.2025-10-21.at.00.18.11.mp4
kurayama commentedon Feb 16, 2026
Same for logs, nested json search/filter does not add LogAttributes, but the root level ones do.
Using clickstack on clickhouse cloud.
cc @teeohhem