Skip to content

Commit 7236044

Browse files
committed
remove unused postAnalysisVerification
1 parent 57299ae commit 7236044

File tree

2 files changed

+2
-19
lines changed
  • x-pack/plugin/esql/src

2 files changed

+2
-19
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Sample.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,16 @@
99
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
1010
import org.elasticsearch.common.io.stream.StreamInput;
1111
import org.elasticsearch.common.io.stream.StreamOutput;
12-
import org.elasticsearch.search.aggregations.bucket.sampler.random.RandomSamplingQuery;
13-
import org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware;
1412
import org.elasticsearch.xpack.esql.capabilities.TelemetryAware;
15-
import org.elasticsearch.xpack.esql.common.Failures;
1613
import org.elasticsearch.xpack.esql.core.expression.Expression;
17-
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
18-
import org.elasticsearch.xpack.esql.core.expression.Foldables;
1914
import org.elasticsearch.xpack.esql.core.tree.NodeInfo;
2015
import org.elasticsearch.xpack.esql.core.tree.Source;
2116
import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput;
2217

2318
import java.io.IOException;
2419
import java.util.Objects;
2520

26-
import static org.elasticsearch.xpack.esql.common.Failure.fail;
27-
28-
public class Sample extends UnaryPlan implements TelemetryAware, PostAnalysisVerificationAware {
21+
public class Sample extends UnaryPlan implements TelemetryAware {
2922
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(LogicalPlan.class, "Sample", Sample::new);
3023

3124
private final Expression probability;
@@ -92,13 +85,4 @@ public boolean equals(Object obj) {
9285

9386
return Objects.equals(probability, other.probability) && Objects.equals(child(), other.child());
9487
}
95-
96-
@Override
97-
public void postAnalysisVerification(Failures failures) {
98-
try {
99-
RandomSamplingQuery.checkProbabilityRange((double) Foldables.valueOf(FoldContext.small(), probability));
100-
} catch (IllegalArgumentException e) {
101-
failures.add(fail(probability, e.getMessage()));
102-
}
103-
}
10488
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
import static org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils.defaultEnrichResolution;
119119
import static org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils.indexWithDateDateNanosUnionType;
120120
import static org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils.loadMapping;
121-
import static org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils.randomValueOtherThanTest;
122121
import static org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils.tsdbIndexResolution;
123122
import static org.elasticsearch.xpack.esql.core.tree.Source.EMPTY;
124123
import static org.elasticsearch.xpack.esql.core.type.DataType.DATETIME;
@@ -3464,7 +3463,7 @@ public void testRrfError() {
34643463
"""));
34653464
assertThat(e.getMessage(), containsString("Unknown column [_id]"));
34663465
}
3467-
3466+
34683467
// TODO There's too much boilerplate involved here! We need a better way of creating FieldCapabilitiesResponses from a mapping or index.
34693468
private static FieldCapabilitiesIndexResponse fieldCapabilitiesIndexResponse(
34703469
String indexName,

0 commit comments

Comments
 (0)