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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.elasticsearch.xpack.esql.plan.logical.LeafPlan;
import org.elasticsearch.xpack.esql.plan.logical.Limit;
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
import org.elasticsearch.xpack.esql.plan.logical.Sample;
import org.elasticsearch.xpack.esql.plan.logical.TopN;
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
import org.elasticsearch.xpack.esql.plan.logical.join.Join;
Expand All @@ -29,7 +28,6 @@
import org.elasticsearch.xpack.esql.plan.physical.LocalSourceExec;
import org.elasticsearch.xpack.esql.plan.physical.LookupJoinExec;
import org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan;
import org.elasticsearch.xpack.esql.plan.physical.SampleExec;
import org.elasticsearch.xpack.esql.plan.physical.TopNExec;

import java.util.List;
Expand Down Expand Up @@ -71,7 +69,6 @@ private PhysicalPlan mapUnary(UnaryPlan unary) {
//
// Pipeline breakers
//

if (unary instanceof Aggregate aggregate) {
List<Attribute> intermediate = MapperUtils.intermediateAttributes(aggregate);
return MapperUtils.aggExec(aggregate, mappedChild, AggregatorMode.INITIAL, intermediate);
Expand All @@ -85,14 +82,9 @@ private PhysicalPlan mapUnary(UnaryPlan unary) {
return new TopNExec(topN.source(), mappedChild, topN.order(), topN.limit(), null);
}

if (unary instanceof Sample sample) {
return new SampleExec(sample.source(), mappedChild, sample.probability());
}

//
// Pipeline operators
//

return MapperUtils.mapUnary(unary, mappedChild);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.elasticsearch.xpack.esql.plan.logical.Limit;
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
import org.elasticsearch.xpack.esql.plan.logical.PipelineBreaker;
import org.elasticsearch.xpack.esql.plan.logical.Sample;
import org.elasticsearch.xpack.esql.plan.logical.TopN;
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
import org.elasticsearch.xpack.esql.plan.logical.inference.Rerank;
Expand All @@ -37,7 +36,6 @@
import org.elasticsearch.xpack.esql.plan.physical.LookupJoinExec;
import org.elasticsearch.xpack.esql.plan.physical.MergeExec;
import org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan;
import org.elasticsearch.xpack.esql.plan.physical.SampleExec;
import org.elasticsearch.xpack.esql.plan.physical.TopNExec;
import org.elasticsearch.xpack.esql.plan.physical.UnaryExec;
import org.elasticsearch.xpack.esql.plan.physical.inference.RerankExec;
Expand Down Expand Up @@ -187,12 +185,6 @@ private PhysicalPlan mapUnary(UnaryPlan unary) {
);
}

// TODO: share code with local LocalMapper?
if (unary instanceof Sample sample) {
mappedChild = addExchangeForFragment(sample, mappedChild);
return new SampleExec(sample.source(), mappedChild, sample.probability());
}

//
// Pipeline operators
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.elasticsearch.xpack.esql.plan.logical.MvExpand;
import org.elasticsearch.xpack.esql.plan.logical.Project;
import org.elasticsearch.xpack.esql.plan.logical.RrfScoreEval;
import org.elasticsearch.xpack.esql.plan.logical.Sample;
import org.elasticsearch.xpack.esql.plan.logical.TimeSeriesAggregate;
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
import org.elasticsearch.xpack.esql.plan.logical.inference.Completion;
Expand All @@ -43,6 +44,7 @@
import org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan;
import org.elasticsearch.xpack.esql.plan.physical.ProjectExec;
import org.elasticsearch.xpack.esql.plan.physical.RrfScoreEvalExec;
import org.elasticsearch.xpack.esql.plan.physical.SampleExec;
import org.elasticsearch.xpack.esql.plan.physical.ShowExec;
import org.elasticsearch.xpack.esql.plan.physical.TimeSeriesAggregateExec;
import org.elasticsearch.xpack.esql.plan.physical.inference.CompletionExec;
Expand Down Expand Up @@ -139,6 +141,10 @@ static PhysicalPlan mapUnary(UnaryPlan p, PhysicalPlan child) {
return new RrfScoreEvalExec(rrf.source(), child, rrf.scoreAttribute(), rrf.forkAttribute());
}

if (p instanceof Sample sample) {
return new SampleExec(sample.source(), child, sample.probability());
}

return unsupported(p);
}

Expand Down