Skip to content

Commit

Permalink
Additional assumeTrue that were missing
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Oct 9, 2024
1 parent 2ff3ec5 commit 43d2463
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1197,10 +1197,14 @@ public void testQueryStringFunctionArgNotNullOrConstant() throws Exception {
}

public void testQueryStringWithDisjunctionsThatCannotBePushedDown() {
assumeTrue("skipping because QSTR is not enabled", EsqlCapabilities.Cap.QSTR_FUNCTION.isEnabled());

checkWithDisjunctionsThatCannotBePushedDown("QSTR", "qstr(\"first_name: Anna\")");
}

public void testMatchWithDisjunctionsThatCannotBePushedDown() {
assumeTrue("skipping because MATCH is not enabled", EsqlCapabilities.Cap.MATCH_FUNCTION.isEnabled());

checkWithDisjunctionsThatCannotBePushedDown("MATCH", "match(first_name, \"Anna\")");
}

Expand Down Expand Up @@ -1232,10 +1236,14 @@ private void checkWithDisjunctionsThatCannotBePushedDown(String functionName, St
}

public void testQueryStringFunctionWithNonBooleanFunctions() {
assumeTrue("skipping because QSTR is not enabled", EsqlCapabilities.Cap.QSTR_FUNCTION.isEnabled());

checkFullTextFunctionsWithNonBooleanFunctions("QSTR", "qstr(\"first_name: Anna\")");
}

public void testMatchFunctionWithNonBooleanFunctions() {
assumeTrue("skipping because MATCH is not enabled", EsqlCapabilities.Cap.MATCH_FUNCTION.isEnabled());

checkFullTextFunctionsWithNonBooleanFunctions("MATCH", "match(first_name, \"Anna\")");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public void testMatchFunction() {
* "source":"emp_no > 10010@2:39"}}],"boost":1.0}}][_doc{f}#14], limit[1000], sort[] estimatedRowSize[324]
*/
public void testMatchFunctionConjunctionWhereOperands() {
assumeTrue("skipping because QSTR_FUNCTION is not enabled", EsqlCapabilities.Cap.MATCH_FUNCTION.isEnabled());
assumeTrue("skipping because MATCH function is not enabled", EsqlCapabilities.Cap.MATCH_FUNCTION.isEnabled());
String queryText = """
from test
| where match(last_name, "Smith") and emp_no > 10010
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.elasticsearch.xpack.esql.EsqlTestUtils;
import org.elasticsearch.xpack.esql.TestBlockFactory;
import org.elasticsearch.xpack.esql.VerificationException;
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
import org.elasticsearch.xpack.esql.analysis.Analyzer;
import org.elasticsearch.xpack.esql.analysis.AnalyzerContext;
import org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils;
Expand Down Expand Up @@ -5567,8 +5568,9 @@ public void testToDatePeriodToTimeDurationWithField() {

// These should pass eventually once we lift some restrictions on match function
public void testMatchWithNonIndexedColumnCurrentlyUnsupported() {
final String header = "Found 1 problem\nline ";
assumeTrue("skipping because MATCH function is not enabled", EsqlCapabilities.Cap.MATCH_FUNCTION.isEnabled());

final String header = "Found 1 problem\nline ";
VerificationException e = expectThrows(VerificationException.class, () -> plan("""
from test | eval initial = substring(first_name, 1) | where match(initial, "A")"""));
assertTrue(e.getMessage().startsWith("Found "));
Expand Down

0 comments on commit 43d2463

Please sign in to comment.