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

Fix failing tests after PR clash #114625

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
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,6 @@ tests:
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=synonyms/60_synonym_rule_get/Synonym rule not found}
issue: https://github.com/elastic/elasticsearch/issues/114444
- class: org.elasticsearch.xpack.esql.optimizer.PhysicalPlanOptimizerTests
method: testPushSpatialIntersectsEvalToSource {default}
issue: https://github.com/elastic/elasticsearch/issues/114627
- class: org.elasticsearch.xpack.esql.optimizer.PhysicalPlanOptimizerTests
method: testPushWhereEvalToSource {default}
issue: https://github.com/elastic/elasticsearch/issues/114628
- class: org.elasticsearch.xpack.inference.integration.ModelRegistryIT
method: testGetModel
issue: https://github.com/elastic/elasticsearch/issues/114657
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3211,28 +3211,28 @@ public void testPushSpatialIntersectsStringToSource() {
/**
* Plan:
* <code>
* LimitExec[1000[INTEGER]]
* \_ExchangeExec[[],false]
* \_FragmentExec[filter=null, estimatedRowSize=0, reducer=[], fragment=[
* EvalExec[[scalerank{f}#8 AS rank]]
* \_LimitExec[1000[INTEGER]]
* \_ExchangeExec[[],false]
* \_FragmentExec[filter=null, estimatedRowSize=0, reducer=[], fragment=[
* Limit[1000[INTEGER]]
* \_Filter[rank{r}#4 lt 4[INTEGER]]
* \_Eval[[scalerank{f}#8 AS rank]]
* \_EsRelation[airports][abbrev{f}#6, city{f}#12, city_location{f}#13, count..]]]
* \_Filter[scalerank{f}#8 &lt; 4[INTEGER]]
* \_EsRelation[airports][abbrev{f}#6, city{f}#12, city_location{f}#13, count..]]]
* </code>
* Optimized:
* <code>
* LimitExec[1000[INTEGER]]
* \_ExchangeExec[[abbrev{f}#6, city{f}#12, city_location{f}#13, country{f}#11, location{f}#10, name{f}#7, scalerank{f}#8,
* type{f}#9, rank{r}#4],false]
* \_ProjectExec[[abbrev{f}#6, city{f}#12, city_location{f}#13, country{f}#11, location{f}#10, name{f}#7, scalerank{f}#8,
* type{f}#9, rank{r}#4]]
* \_FieldExtractExec[abbrev{f}#6, city{f}#12, city_location{f}#13, count..][]
* \_LimitExec[1000[INTEGER]]
* \_EvalExec[[scalerank{f}#8 AS rank]]
* \_FieldExtractExec[scalerank{f}#8][]
* \_EsQueryExec[airports], indexMode[standard], query[{"
* esql_single_value":{"field":"scalerank","next":{"range":{"scalerank":{"lt":4,"boost":1.0}}},"source":"rank &lt; 4@3:9"}
* }][_doc{f}#23], limit[], sort[] estimatedRowSize[304]
* EvalExec[[scalerank{f}#8 AS rank]]
* \_LimitExec[1000[INTEGER]]
* \_ExchangeExec[[abbrev{f}#6, city{f}#12, city_location{f}#13, country{f}#11, location{f}#10, name{f}#7, scalerank{f}#8,
* type{f}#9],false
* ]
* \_ProjectExec[[abbrev{f}#6, city{f}#12, city_location{f}#13, country{f}#11, location{f}#10, name{f}#7, scalerank{f}#8,
* type{f}#9]
* ]
* \_FieldExtractExec[abbrev{f}#6, city{f}#12, city_location{f}#13, count..][]
* \_EsQueryExec[airports], indexMode[standard], query[{
* "esql_single_value":{"field":"scalerank","next":{"range":{"scalerank":{"lt":4,"boost":1.0}}},"source":"rank &lt; 4@3:9"}
* ][_doc{f}#23], limit[1000], sort[] estimatedRowSize[304]
* </code>
*/
public void testPushWhereEvalToSource() {
Expand All @@ -3243,24 +3243,23 @@ public void testPushWhereEvalToSource() {
""";

var plan = this.physicalPlan(query, airports);
var limit = as(plan, LimitExec.class);
var eval = as(plan, EvalExec.class);
var limit = as(eval.child(), LimitExec.class);
var exchange = as(limit.child(), ExchangeExec.class);
var fragment = as(exchange.child(), FragmentExec.class);
var limit2 = as(fragment.fragment(), Limit.class);
var filter = as(limit2.child(), Filter.class);
assertThat("filter contains LessThan", filter.condition(), instanceOf(LessThan.class));

var optimized = optimizedPlan(plan);
var topLimit = as(optimized, LimitExec.class);
eval = as(optimized, EvalExec.class);
var topLimit = as(eval.child(), LimitExec.class);
exchange = as(topLimit.child(), ExchangeExec.class);
var project = as(exchange.child(), ProjectExec.class);
var fieldExtract = as(project.child(), FieldExtractExec.class);
assertThat(fieldExtract.attributesToExtract().size(), greaterThan(5));
limit = as(fieldExtract.child(), LimitExec.class);
var eval = as(limit.child(), EvalExec.class);
fieldExtract = as(eval.child(), FieldExtractExec.class);
assertThat(fieldExtract.attributesToExtract().stream().map(Attribute::name).collect(Collectors.toList()), contains("scalerank"));
var source = source(fieldExtract.child());
assertThat(source.limit(), is(topLimit.limit()));
var condition = as(source.query(), SingleValueQuery.Builder.class);
alex-spies marked this conversation as resolved.
Show resolved Hide resolved
assertThat("Expected predicate to be passed to Lucene query", condition.source().text(), equalTo("rank < 4"));
assertThat("Expected field to be passed to Lucene query", condition.field(), equalTo("scalerank"));
Expand All @@ -3281,24 +3280,23 @@ public void testPushSpatialIntersectsEvalToSource() {
""" }) {

var plan = this.physicalPlan(query, airports);
var limit = as(plan, LimitExec.class);
var eval = as(plan, EvalExec.class);
var limit = as(eval.child(), LimitExec.class);
var exchange = as(limit.child(), ExchangeExec.class);
var fragment = as(exchange.child(), FragmentExec.class);
var limit2 = as(fragment.fragment(), Limit.class);
var filter = as(limit2.child(), Filter.class);
assertThat("filter contains ST_INTERSECTS", filter.condition(), instanceOf(SpatialIntersects.class));

var optimized = optimizedPlan(plan);
var topLimit = as(optimized, LimitExec.class);
eval = as(optimized, EvalExec.class);
var topLimit = as(eval.child(), LimitExec.class);
exchange = as(topLimit.child(), ExchangeExec.class);
var project = as(exchange.child(), ProjectExec.class);
var fieldExtract = as(project.child(), FieldExtractExec.class);
assertThat(fieldExtract.attributesToExtract().size(), greaterThan(5));
limit = as(fieldExtract.child(), LimitExec.class);
var eval = as(limit.child(), EvalExec.class);
fieldExtract = as(eval.child(), FieldExtractExec.class);
assertThat(fieldExtract.attributesToExtract().stream().map(Attribute::name).collect(Collectors.toList()), contains("location"));
var source = source(fieldExtract.child());
assertThat(source.limit(), is(topLimit.limit()));
var condition = as(source.query(), SpatialRelatesQuery.ShapeQueryBuilder.class);
assertThat("Geometry field name", condition.fieldName(), equalTo("location"));
assertThat("Spatial relationship", condition.relation(), equalTo(ShapeRelation.INTERSECTS));
Expand Down