UI generates invalid ClickHouse queries when filtering on parsed JSON strings
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 471
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 117
Description
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
StatusMessagefield (stored as aStringin 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.indexwith 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
simpleJSONExtractStringfor basic field matching as it's more reliable for nested JSON - Fall back to
JSONExtractStringonly 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the HyperDX UI with a JSON string in the ClickHouse StatusMessage column, then inspect the query generated by Search for this value only for a nested field. Done means the UI generates a valid ClickHouse query using the appropriate JSON extraction function and the filter works without a syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, typescript
- Domain
- databases, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100