diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java index 5f9c14e2fda61..fb617a78776cc 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java @@ -3405,6 +3405,8 @@ public void testRrfError() { } public void testRandomSampleProbability() { + assumeTrue("requires SAMPLE capability", EsqlCapabilities.Cap.SAMPLE.isEnabled()); + var e = expectThrows(VerificationException.class, () -> analyze("FROM test | SAMPLE 1.")); assertThat(e.getMessage(), containsString("RandomSampling probability must be strictly between 0.0 and 1.0, was [1.0]")); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java index bc08f14867f56..54e9e7d2b0f94 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java @@ -3486,6 +3486,7 @@ public void testInvalidCompletion() { } public void testSample() { + assumeTrue("SAMPLE requires corresponding capability", EsqlCapabilities.Cap.SAMPLE.isEnabled()); expectError("FROM test | SAMPLE .1 2 3", "line 1:25: extraneous input '3' expecting "); expectError("FROM test | SAMPLE .1 \"2\"", "line 1:23: extraneous input '\"2\"' expecting "); expectError("FROM test | SAMPLE 1", "line 1:20: mismatched input '1' expecting {DECIMAL_LITERAL, '+', '-'}"); diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml index 40c720584dbf1..f4a6f48e27ddf 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml @@ -139,7 +139,7 @@ setup: - do: {xpack.usage: {}} - match: { esql.available: true } - match: { esql.enabled: true } - - length: { esql.features: 25 } + - length: { esql.features: 26 } - set: {esql.features.dissect: dissect_counter} - set: {esql.features.drop: drop_counter} - set: {esql.features.eval: eval_counter} @@ -165,6 +165,7 @@ setup: - set: {esql.features.fork: fork_counter} - set: {esql.features.rrf: rrf_counter} - set: {esql.features.completion: completion_counter} + - set: {esql.features.sample: sample_counter} - length: { esql.queries: 3 } - set: {esql.queries.rest.total: rest_total_counter} - set: {esql.queries.rest.failed: rest_failed_counter} @@ -220,7 +221,7 @@ setup: - gt: {esql.functions.to_long: $functions_to_long} - match: {esql.functions.coalesce: $functions_coalesce} - gt: {esql.functions.categorize: $functions_categorize} - - length: {esql.functions: 131} # check the "sister" test above for a likely update to the same esql.functions length check + - length: {esql.functions: 132} # check the "sister" test above for a likely update to the same esql.functions length check --- took: