Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Conversation

@nablaone
Copy link
Member

@nablaone nablaone commented Mar 4, 2025

This is experimental support for accessing Map columns (String,...).

For example:

CREATE TABLE IF NOT EXISTS "foo"
(
    "@timestamp" DateTime64 DEFAULT now64(),
    `bar` Map(String, Nullable(String))
)
ENGINE = MergeTree
ORDER BY ("@timestamp");        

insert into foo values ('2020-01-01 00:00:00', {'a': 'b'});
insert into foo values ('2020-01-01 00:00:00', {'c': 'd', 'e': 'f'});
insert into foo values ('2020-01-01 00:00:00', {'g': 'h', 'i': 'j', 'k': 'l'});

We can access the value of the map by using fieldname.key syntax

{
    "query": {
        "bool": {
            "must": [
                {
                    "match": {
                        "bar.a": "b"
                    }
                }
            ]
        },
        "match_all": {}
    }
}

Feature is disabled by default, it can be enabled by:

        foo:
            enableFieldMapSyntax: true
            target: [ my-clickhouse-data-source ]

@nablaone nablaone changed the title Field map syntax Experimental - Field map syntax Mar 4, 2025
@nablaone nablaone marked this pull request as ready for review March 5, 2025 11:06
@nablaone nablaone requested a review from a team as a code owner March 5, 2025 11:06
Copy link
Member

@mieciu mieciu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to have this merged sooner than later, but please remember to add note in docs about this new config option (in a separate PR).

@jakozaur
Copy link
Contributor

jakozaur commented Mar 5, 2025

@mieciu @nablaone @pdelewski For now, it is an experimental feature. We should design later a proper way to pass extra options.

@pdelewski
Copy link
Contributor

@mieciu @nablaone @pdelewski For now, it is an experimental feature. We should design later a proper way to pass extra options.

Added issue for tracking that #1351

@pdelewski pdelewski added this pull request to the merge queue Mar 5, 2025
Merged via the queue into main with commit 4a191fe Mar 5, 2025
6 checks passed
@pdelewski pdelewski deleted the pr-map-keys branch March 5, 2025 13:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants