Skip to content

ESQL: Check a few toStrings for aggs #132700

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
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Aug 12, 2025

Adds toString checking for aggregators to the generic aggs test cases so we can make sure they spit out sensible looking results. We have this for scalar functions but it isn't plugged in for aggs and I noticed it while working on #132603 where I stuck asdf for the toString thinking I'd fix it when the test failed. It didn't.

There's to many changes to grab this in one go so I've made a hook that tests can opt into. We'll drop the hook once everything has opted into it.

Adds `toString` checking for aggregators to the generic aggs test cases
so we can make sure they spit out sensible looking results. We have this
for scalar functions but it isn't plugged in for aggs and I noticed it
while working on elastic#132603 where I stuck `asdf` for the toString thinking
I'd fix it when the test failed. It didn't.

There's to many changes to grab this in one go so I've made a hook that
tests can opt into. We'll drop the hook once everything has opted into
it.
@nik9000 nik9000 requested a review from ivancea August 12, 2025 01:59
@nik9000 nik9000 added >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL v9.2.0 labels Aug 12, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Aug 12, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@ivancea ivancea left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe we should make an issue to remove the optIn flag

@@ -187,6 +190,7 @@ private void aggregateGroupingSingleMode(Expression expression) {
assumeFalse("Grouping aggregations must receive data to check results", pages.isEmpty());

try (var aggregator = groupingAggregator(expression, initialInputChannels(), AggregatorMode.SINGLE)) {
assertAggregatorToString(aggregator);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move these be their own tests, like in the scalars?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably should. I'll do that before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants