Skip to content

ESQL: InferNonNullAggConstraint using wrong field name for union types #127521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alex-spies opened this issue Apr 29, 2025 · 1 comment
Open
Assignees
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@alex-spies
Copy link
Contributor

alex-spies commented Apr 29, 2025

@bpintea found another instance where we use FieldAttribute#name instead of FieldAttribute#fieldName; in case of union types (and so far only union types), these two differ with name being a synthetic string like $$field$converted_to$integer whereas fieldName contains the actual name of the field in the index.

C.f. #127225 (comment). As outlined in my comment, I think it'd be best to avoid this bug at compile time, by making our SearchStats require not just Strings for field names, but either EsFields (contained in every FieldAttribute) or a dedicated wrapper class/record like FieldName to be returned by FieldAttribute#fieldName (but not FieldAttribute#name).

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 29, 2025
@elasticsearchmachine
Copy link
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 Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

2 participants