Skip to main content
Elasticsearch and ClickHouse support a wide variety of data types, but their underlying storage and query models are fundamentally different. This section maps commonly used Elasticsearch field types to their ClickHouse equivalents, where available, and provides context to help guide migrations. Where no equivalent exists, alternatives or notes are provided in the comments.

Notes

  • Arrays: In Elasticsearch, all fields support arrays natively. In ClickHouse, arrays must be explicitly defined (e.g., Array(String)), with the advantage specific positions can be accessed and queried e.g. an_array[1].
  • Multi-fields: Elasticsearch allows indexing the same field multiple ways (e.g., both text and keyword). In ClickHouse, this pattern must be modeled using separate columns or views.
  • Map and JSON Types - In ClickHouse, the Map type is commonly used to model dynamic key-value structures such as resourceAttributes and logAttributes. This type enables flexible schema-less ingestion by allowing arbitrary keys to be added at runtime — similar in spirit to JSON objects in Elasticsearch. However, there are important limitations to consider:
    • Uniform value types: ClickHouse Map columns must have a consistent value type (e.g., Map(String, String)). Mixed-type values aren’t supported without coercion.
    • Performance cost: accessing any key in a Map requires loading the entire map into memory, which can be suboptimal for performance.
    • No subcolumns: unlike JSON, keys in a Map aren’t represented as true subcolumns, which limits ClickHouse’s ability to index, compress, and query efficiently.
    Because of these limitations, ClickStack is migrating away from Map in favor of ClickHouse’s enhanced JSON type. The JSON type addresses many of the shortcomings of Map:
    • True columnar storage: each JSON path is stored as a subcolumn, allowing efficient compression, filtering, and vectorized query execution.
    • Mixed-type support: different data types (e.g., integers, strings, arrays) can coexist under the same path without coercion or type unification.
    • File system scalability: internal limits on dynamic keys (max_dynamic_paths) and types (max_dynamic_types) prevent an explosion of column files on disk, even with high cardinality key sets.
    • Dense storage: nulls and missing values are stored sparsely to avoid unnecessary overhead. The JSON type is especially well-suited for observability workloads, offering the flexibility of schemaless ingestion with the performance and scalability of native ClickHouse types — making it an ideal replacement for Map in dynamic attribute fields. For further details on the JSON type we recommend the JSON guide and “How we built a new powerful JSON data type for ClickHouse”.
Last modified on July 2, 2026