Skip to content

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

Closed

Description

@tefimov

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.

Activity

  1. pulpdrew commented on Sep 8, 2026

    @pulpdrew
    Contributor

    Thanks for reporting @tefimov. Agreed that it would be nicer to have just the property name as the column header by default, and that adding AS "<property>" would be the way to do this. We can probably generate the aliases when updating the query, we'll just need to be careful with quoting and escaping. We'll add this to the backlog, and would welcome external contributions.

  2. added a commit that references this issue on Sep 28, 2026
    0c93eab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions