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
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,6 @@ tests:
- class: org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistryTests
method: testRegisteredFunctionHaveTests
issue: https://github.com/elastic/elasticsearch/issues/144076
- class: org.elasticsearch.xpack.esql.analysis.VerifierTests
method: testMMRLimitedInput
issue: https://github.com/elastic/elasticsearch/issues/144077

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3790,8 +3790,6 @@ public void testUnsupportedMetadata() {
}

public void testMMRDiversifyFieldIsValid() {
assumeTrue("MMR requires corresponding capability", EsqlCapabilities.Cap.MMR_V2.isEnabled());
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cap is always enabled - these checks can be removed.


query("row dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector | mmr on dense_embedding limit 10");

assertThat(
Expand All @@ -3801,8 +3799,6 @@ public void testMMRDiversifyFieldIsValid() {
}

public void testMMRLimitIsValid() {
assumeTrue("MMR requires corresponding capability", EsqlCapabilities.Cap.MMR_V2.isEnabled());

query("row dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector | mmr on dense_embedding limit 10");

assertThat(
Expand All @@ -3816,8 +3812,6 @@ public void testMMRLimitIsValid() {
}

public void testMMRResolvedQueryVectorIsValid() {
assumeTrue("MMR requires corresponding capability", EsqlCapabilities.Cap.MMR_V2.isEnabled());

query(
"row dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector | mmr [0.5, 0.4, 0.3, 0.2]::dense_vector on dense_embedding limit 10"
);
Expand All @@ -3833,8 +3827,6 @@ public void testMMRResolvedQueryVectorIsValid() {
}

public void testMMRLambdaValueIsValid() {
assumeTrue("MMR requires corresponding capability", EsqlCapabilities.Cap.MMR_V2.isEnabled());

query("row dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector | mmr on dense_embedding limit 10 with { \"lambda\": 0.5 }");

assertThat(
Expand Down Expand Up @@ -3875,19 +3867,19 @@ public void testMMRLambdaValueIsValid() {
}

public void testMMRLimitedInput() {
assumeTrue("MMR requires corresponding capability", EsqlCapabilities.Cap.MMR_V2.isEnabled());

assertThat(error("""
FROM test
| EVAL dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector
| MMR ON dense_embedding LIMIT 10
"""), containsString("MMR can only be used on a limited number of rows. Consider adding a LIMIT before MMR."));

assertThat(error("""
FROM (FROM test METADATA _index, _id, _score | EVAL dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector),
(FROM test METADATA _index, _id, _score | LIMIT 10)
| MMR ON dense_embedding LIMIT 10
"""), containsString("MMR can only be used on a limited number of rows. Consider adding a LIMIT before MMR."));
if (EsqlCapabilities.Cap.SUBQUERY_IN_FROM_COMMAND.isEnabled()) {
assertThat(error("""
FROM (FROM test METADATA _index, _id, _score | EVAL dense_embedding=[0.5, 0.4, 0.3, 0.2]::dense_vector),
(FROM test METADATA _index, _id, _score | LIMIT 10)
| MMR ON dense_embedding LIMIT 10
"""), containsString("MMR can only be used on a limited number of rows. Consider adding a LIMIT before MMR."));
}
}

public void testTopSnippetsQueryFoldableAfterOptimization() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4534,8 +4534,6 @@ public Double getLambdaFromMMROptions(@Nullable MapExpression options) {
}

public void testInvalidMMRCommands() {
assumeTrue("MMR requires corresponding capability", EsqlCapabilities.Cap.MMR_V2.isEnabled());

expectError("row a = 1 | mmr on some_field", "line 1:30: mismatched input '<EOF>' expecting {'.', MMR_LIMIT}");
expectError("row a = 1 | mmr on some_field limit", "line 1:36: mismatched input '<EOF>' expecting {INTEGER_LITERAL, '+', '-'}");
expectError(
Expand Down
Loading