Skip to content

ESQL: Don't accidentally add flattened subfields#154999

Open
kkharbas wants to merge 1 commit into
elastic:patch/serverless-fixfrom
kkharbas:esql-flattened-subfields-serverless-fix
Open

ESQL: Don't accidentally add flattened subfields#154999
kkharbas wants to merge 1 commit into
elastic:patch/serverless-fixfrom
kkharbas:esql-flattened-subfields-serverless-fix

Conversation

@kkharbas

@kkharbas kkharbas commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Cherry-pick of #154508 onto patch/serverless-fix.

From original PR:
We were accidentally adding flattened sub fields in queries like:

FROM idx_date, idx_flat_date
| STATS c = COUNT(metadata.time)

In idx_date the metadata.time field is mapped as date. In idx_flat_date the metadata field is mapped as flattened.

Without this fix we see the date as a real, partially mapped field. So we proceed to process it. On the data node we see the flattened sub field and load it like a keyword field. Which confuses everything! Because we're expecting a date field.

Closes #154011
Closes #154484
Closes #154743

We were accidentally adding flattened sub fields in queries like:
```
FROM idx_date, idx_flat_date
| STATS c = COUNT(metadata.time)
```
In `idx_date` the `metadata.time` field is mapped as `date`. In `idx_flat_date` the `metadata` field is mapped as `flattened`.

Without this fix we see the `date` as a real, partially mapped field. So we proceed to process it. On the data node we see the `flattened` sub field and load it like a `keyword` field. Which confuses everything! Because we're expecting a `date` field.

Closes elastic#154011
Closes elastic#154484
@kkharbas kkharbas added >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL labels Jul 24, 2026
@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Jul 24, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >bug serverless-linked Added by automation, don't add manually Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants