hyperdxio / hyperdxio/hyperdx

Map attribute columns are labelled `arrayElement(LogAttributes, 'key')` in the results table instead of the field name

Open Beginner friendly
#3,095 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement external good first issue
Dominant language
TypeScript
Stars
9.9k
Forks
471
Avg merge
2d 4h
Merged PRs (30d)
117

Description

Selecting a map attribute as a column labels it with the raw ClickHouse function form. A user who adds LogAttributes['constructor.index_builder_ac_res_id'] gets a results-table header reading:

arrayElement(LogAttributes, 'constructor.index_builder_ac_res_id')

At our column widths that header is wider than the value it sits over, and several such columns make the table unreadable. The same string shows up in the SELECT box and in chart legends.

Cause. The generated SQL emits the subscript expression with no alias, so ClickHouse names the result column with the canonical function form. That naming is ClickHouse behaviour, not a bug — it happens for any unaliased Map subscript:

DESCRIBE (SELECT LogAttributes['constructor.index_builder_ac_res_id'],
                 ResourceAttributes['service.name']
          FROM otel.otel_logs LIMIT 0)
arrayElement(LogAttributes, 'constructor.index_builder_ac_res_id')   String
arrayElement(ResourceAttributes, 'service.name')                     String

Expected. The column is labelled with the field name the user picked — constructor.index_builder_ac_res_id, or LogAttributes.constructor.index_builder_ac_res_id if the prefix is wanted for disambiguation. Adding AS to the generated select is enough; the display name is already known at the point the SQL is built.

Environment. ClickHouse Cloud 26.4.1.2212, Map(LowCardinality(String), String) attribute columns, standard OTel logs schema.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the SQL-generation path for map-attribute column selections, where the selected field name is already available. Confirm how the generated SELECT is used by the results table, SELECT box, and chart legends, then verify that each displays the chosen field name rather than ClickHouse’s raw arrayElement form.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.