Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,6 @@ tests:
- class: org.elasticsearch.search.query.VectorIT
method: testFilteredQueryStrategy
issue: https://github.com/elastic/elasticsearch/issues/129517
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/129453
- class: org.elasticsearch.test.apmintegration.TracesApmIT
method: testApmIntegration
issue: https://github.com/elastic/elasticsearch/issues/129651
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.DropGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EnrichGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EvalGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.ForkGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.GrokGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.KeepGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.LimitGenerator;
Expand Down Expand Up @@ -54,7 +53,8 @@ public record QueryExecuted(String query, int depth, List<Column> outputSchema,
DropGenerator.INSTANCE,
EnrichGenerator.INSTANCE,
EvalGenerator.INSTANCE,
ForkGenerator.INSTANCE,
// Awaits fix: https://github.com/elastic/elasticsearch/issues/129715
// ForkGenerator.INSTANCE,
GrokGenerator.INSTANCE,
KeepGenerator.INSTANCE,
LimitGenerator.INSTANCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ public ValidationResult validateOutput(
List<List<Object>> output
) {
int limit = (int) commandDescription.context().get(LIMIT);
boolean defaultLimit = false;
for (CommandDescription previousCommand : previousCommands) {
if (previousCommand.commandName().equals(LIMIT)) {
defaultLimit = true;
}
}

if (previousOutput.size() > limit && output.size() != limit || defaultLimit && previousOutput.size() < output.size()) {
return new ValidationResult(false, "Expecting [" + limit + "] records, got [" + output.size() + "]");
if (output.size() > limit) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, which queries weren't deterministic in the number of rows?

Copy link
Contributor Author

@luigidellaquila luigidellaquila Jun 19, 2025

Choose a reason for hiding this comment

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

All the queries that have a very early LIMIT are very non-deterministic, eg.

FROM idx
| LIMIT 10
| WHERE <something>
| LIMIT 10

the WHERE condition receives very few (random) records, at every run I expect zero to ten (different) results.

This said, in the CI I found some very suspicious queries that I'm investigating now, but for the general case I don't think we can do better than this for now

return new ValidationResult(false, "Expecting at most [" + limit + "] records, got [" + output.size() + "]");
}
return CommandGenerator.expectSameColumns(previousColumns, columns);
}
Expand Down