Skip to content

Commit

Permalink
Fix node tests for ToPartial (#110448) (#110531)
Browse files Browse the repository at this point in the history
This change makes the three-parameter constructor of ToPartial public so 
that EsqlNodeSubclassTests can pick it up properly.

Closes #110310
  • Loading branch information
dnhatn authored Jul 5, 2024
1 parent 3f2c81e commit 779a5f0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ tests:
- class: org.elasticsearch.backwards.SearchWithMinCompatibleSearchNodeIT
method: testMinVersionAsOldVersion
issue: https://github.com/elastic/elasticsearch/issues/109454
- class: org.elasticsearch.xpack.esql.tree.EsqlNodeSubclassTests
method: testReplaceChildren {class org.elasticsearch.xpack.esql.expression.function.aggregate.ToPartial}
issue: https://github.com/elastic/elasticsearch/issues/110310
- class: org.elasticsearch.xpack.esql.tree.EsqlNodeSubclassTests
method: testInfoParameters {class org.elasticsearch.xpack.esql.expression.function.aggregate.ToPartial}
issue: https://github.com/elastic/elasticsearch/issues/110310
- class: org.elasticsearch.search.vectors.ExactKnnQueryBuilderTests
method: testToQuery
issue: https://github.com/elastic/elasticsearch/issues/110357
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ public class ToPartial extends AggregateFunction implements ToAggregator {

private final Expression function;

public ToPartial(Source source, AggregateFunction function) {
super(source, function.field(), List.of(function));
this.function = function;
}

private ToPartial(Source source, Expression field, Expression function) {
public ToPartial(Source source, Expression field, Expression function) {
super(source, field, List.of(function));
this.function = function;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ LogicalPlan translate(Aggregate metrics) {
if (changed.get()) {
secondPassAggs.add(new Alias(alias.source(), alias.name(), null, outerAgg, agg.id()));
} else {
var toPartial = new Alias(agg.source(), alias.name(), new ToPartial(agg.source(), af));
var toPartial = new Alias(agg.source(), alias.name(), new ToPartial(agg.source(), af.field(), af));
var fromPartial = new FromPartial(agg.source(), toPartial.toAttribute(), af);
firstPassAggs.add(toPartial);
secondPassAggs.add(new Alias(alias.source(), alias.name(), null, fromPartial, alias.id()));
Expand Down

0 comments on commit 779a5f0

Please sign in to comment.