Skip to content

Commit e47f0db

Browse files
committed
fix + extend ApproximateTests
1 parent 3eac180 commit e47f0db

File tree

3 files changed

+163
-125
lines changed

3 files changed

+163
-125
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private Iterator<? extends ToXContent> onlyFailuresToXContent() {
316316
* @return a stream of clusters with that status
317317
*/
318318
public Stream<Cluster> getClusterStates(Cluster.Status status) {
319-
// assert clusterInfo.isEmpty() == false : "ClusterMap in EsqlExecutionInfo must not be empty";
319+
assert clusterInfo.isEmpty() == false : "ClusterMap in EsqlExecutionInfo must not be empty";
320320
return clusterInfo.values().stream().filter(cluster -> cluster.getStatus() == status);
321321
}
322322

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/approximate/Approximate.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.elasticsearch.xpack.esql.plan.logical.Row;
6363
import org.elasticsearch.xpack.esql.plan.logical.Sample;
6464
import org.elasticsearch.xpack.esql.plan.logical.TopN;
65-
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
6665
import org.elasticsearch.xpack.esql.plan.logical.inference.Completion;
6766
import org.elasticsearch.xpack.esql.plan.logical.inference.Rerank;
6867
import org.elasticsearch.xpack.esql.plan.logical.local.EsqlProject;
@@ -83,14 +82,12 @@
8382
* A query is currently suitable for approximation if:
8483
* <ul>
8584
* <li> it contains exactly one {@code STATS} command
86-
* <li> the other commands are from the supported set
87-
* ({@link Approximate#SUPPORTED_COMMANDS}); this contains almost all
88-
* unary commands, but no {@code FORK} or {@code JOIN}.
85+
* <li> the other processing commands are from the supported set
86+
* ({@link Approximate#SUPPORTED_COMMANDS}); this set contains almost all
87+
* unary commands, but most notably not {@code FORK} or {@code JOIN}.
8988
* <li> the aggregate functions are from the supported set
9089
* ({@link Approximate#SUPPORTED_SINGLE_VALUED_AGGS} and
9190
* {@link Approximate#SUPPORTED_MULTIVALUED_AGGS})
92-
* <li> it contains only unary commands (so no {@code FORK} or {@code JOIN})
93-
* <li> it doesn't contain a forbidden command (
9491
* </ul>
9592
* Some of these restrictions may be lifted in the future.
9693
* <p>
@@ -273,7 +270,7 @@ private boolean verifyPlan() throws VerificationException {
273270
List.of(
274271
Failure.fail(
275272
aggFn,
276-
"aggregation function [" + aggFn.nodeName().toUpperCase() + "] cannot be approximated"
273+
"aggregation function [" + aggFn.nodeName().toUpperCase(Locale.ROOT) + "] cannot be approximated"
277274
)
278275
)
279276
);

0 commit comments

Comments
 (0)