mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
ES|QL: Fix generative tests (#129717)
This commit is contained in:
parent
eeca493860
commit
0dba16384e
3 changed files with 4 additions and 13 deletions
|
@ -562,9 +562,6 @@ tests:
|
||||||
- class: org.elasticsearch.search.query.VectorIT
|
- class: org.elasticsearch.search.query.VectorIT
|
||||||
method: testFilteredQueryStrategy
|
method: testFilteredQueryStrategy
|
||||||
issue: https://github.com/elastic/elasticsearch/issues/129517
|
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
|
- class: org.elasticsearch.test.apmintegration.TracesApmIT
|
||||||
method: testApmIntegration
|
method: testApmIntegration
|
||||||
issue: https://github.com/elastic/elasticsearch/issues/129651
|
issue: https://github.com/elastic/elasticsearch/issues/129651
|
||||||
|
|
|
@ -13,7 +13,6 @@ import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.DissectGener
|
||||||
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.DropGenerator;
|
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.EnrichGenerator;
|
||||||
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EvalGenerator;
|
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.GrokGenerator;
|
||||||
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.KeepGenerator;
|
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.KeepGenerator;
|
||||||
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.LimitGenerator;
|
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.LimitGenerator;
|
||||||
|
@ -54,7 +53,8 @@ public class EsqlQueryGenerator {
|
||||||
DropGenerator.INSTANCE,
|
DropGenerator.INSTANCE,
|
||||||
EnrichGenerator.INSTANCE,
|
EnrichGenerator.INSTANCE,
|
||||||
EvalGenerator.INSTANCE,
|
EvalGenerator.INSTANCE,
|
||||||
ForkGenerator.INSTANCE,
|
// Awaits fix: https://github.com/elastic/elasticsearch/issues/129715
|
||||||
|
// ForkGenerator.INSTANCE,
|
||||||
GrokGenerator.INSTANCE,
|
GrokGenerator.INSTANCE,
|
||||||
KeepGenerator.INSTANCE,
|
KeepGenerator.INSTANCE,
|
||||||
LimitGenerator.INSTANCE,
|
LimitGenerator.INSTANCE,
|
||||||
|
|
|
@ -42,15 +42,9 @@ public class LimitGenerator implements CommandGenerator {
|
||||||
List<List<Object>> output
|
List<List<Object>> output
|
||||||
) {
|
) {
|
||||||
int limit = (int) commandDescription.context().get(LIMIT);
|
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()) {
|
if (output.size() > limit) {
|
||||||
return new ValidationResult(false, "Expecting [" + limit + "] records, got [" + output.size() + "]");
|
return new ValidationResult(false, "Expecting at most [" + limit + "] records, got [" + output.size() + "]");
|
||||||
}
|
}
|
||||||
return CommandGenerator.expectSameColumns(previousColumns, columns);
|
return CommandGenerator.expectSameColumns(previousColumns, columns);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue