Skip to content
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

ESQL: isNotNullAndFoldable should not perform a fold #119756

Open
alex-spies opened this issue Jan 8, 2025 · 2 comments
Open

ESQL: isNotNullAndFoldable should not perform a fold #119756

alex-spies opened this issue Jan 8, 2025 · 2 comments
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >tech debt

Comments

@alex-spies
Copy link
Contributor

This helper method is used in type checks/resolutions and checks whether a value is not null.

This check really shouldn't happen at the time when we perform type resolutions - type resolutions shouldn't depend on individual values.

More importantly, folding values can be expensive - we should only perform this in the ConstantFolding and FoldNulls steps of the logical optimizer.

We may be able to use the Validatable interface to perform the null-check after the logical optimizer step, when all foldables can be assumed to be already folded.

This is currently used in Top, FullTextFunction and Match.

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jan 8, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@alex-spies
Copy link
Contributor Author

Additionally marking this as a bug because this is relevant to the memory tracking that is being added in #118602.

@alex-spies alex-spies added >bug and removed Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Jan 8, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jan 8, 2025
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) >tech debt
Projects
None yet
Development

No branches or pull requests

2 participants