Skip to content

Commit 2fa7aac

Browse files
alex-spiesMax Hniebergall
authored andcommitted
ESQL: Fix lookup optimizer tests on release (elastic#118742) (elastic#118750)
Fix elastic#118721 * Skip corresponding optimizer tests if `LOOKUP JOIN` is disabled. * Enable LogicalPlanOptimizerTests again. (cherry picked from commit bb8503a) # Conflicts: # muted-tests.yml
1 parent 63d89f2 commit 2fa7aac

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

muted-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,5 +470,3 @@ tests:
470470
- class: org.elasticsearch.index.engine.RecoverySourcePruneMergePolicyTests
471471
method: testPruneSome
472472
issue: https://github.com/elastic/elasticsearch/issues/118728
473-
- class: org.elasticsearch.xpack.esql.optimizer.LogicalPlanOptimizerTests
474-
issue: https://github.com/elastic/elasticsearch/issues/118721

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizerTests.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.elasticsearch.xpack.esql.EsqlTestUtils;
2222
import org.elasticsearch.xpack.esql.TestBlockFactory;
2323
import org.elasticsearch.xpack.esql.VerificationException;
24+
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
2425
import org.elasticsearch.xpack.esql.analysis.Analyzer;
2526
import org.elasticsearch.xpack.esql.analysis.AnalyzerContext;
2627
import org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils;
@@ -4910,6 +4911,8 @@ public void testPlanSanityCheck() throws Exception {
49104911
}
49114912

49124913
public void testPlanSanityCheckWithBinaryPlans() throws Exception {
4914+
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V5.isEnabled());
4915+
49134916
var plan = optimizedPlan("""
49144917
FROM test
49154918
| RENAME languages AS language_code
@@ -5913,6 +5916,8 @@ public void testLookupStats() {
59135916
* \_EsRelation[language_code][LOOKUP][language_code{f}#18, language_name{f}#19]
59145917
*/
59155918
public void testLookupJoinPushDownFilterOnJoinKeyWithRename() {
5919+
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V5.isEnabled());
5920+
59165921
String query = """
59175922
FROM test
59185923
| RENAME languages AS language_code
@@ -5954,6 +5959,8 @@ public void testLookupJoinPushDownFilterOnJoinKeyWithRename() {
59545959
* \_EsRelation[language_code][LOOKUP][language_code{f}#18, language_name{f}#19]
59555960
*/
59565961
public void testLookupJoinPushDownFilterOnLeftSideField() {
5962+
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V5.isEnabled());
5963+
59575964
String query = """
59585965
FROM test
59595966
| RENAME languages AS language_code
@@ -5996,6 +6003,8 @@ public void testLookupJoinPushDownFilterOnLeftSideField() {
59966003
* \_EsRelation[language_code][LOOKUP][language_code{f}#18, language_name{f}#19]
59976004
*/
59986005
public void testLookupJoinPushDownDisabledForLookupField() {
6006+
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V5.isEnabled());
6007+
59996008
String query = """
60006009
FROM test
60016010
| RENAME languages AS language_code
@@ -6039,6 +6048,8 @@ public void testLookupJoinPushDownDisabledForLookupField() {
60396048
* \_EsRelation[language_code][LOOKUP][language_code{f}#19, language_name{f}#20]
60406049
*/
60416050
public void testLookupJoinPushDownSeparatedForConjunctionBetweenLeftAndRightField() {
6051+
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V5.isEnabled());
6052+
60426053
String query = """
60436054
FROM test
60446055
| RENAME languages AS language_code
@@ -6090,6 +6101,8 @@ public void testLookupJoinPushDownSeparatedForConjunctionBetweenLeftAndRightFiel
60906101
* \_EsRelation[language_code][LOOKUP][language_code{f}#19, language_name{f}#20]
60916102
*/
60926103
public void testLookupJoinPushDownDisabledForDisjunctionBetweenLeftAndRightField() {
6104+
assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V5.isEnabled());
6105+
60936106
String query = """
60946107
FROM test
60956108
| RENAME languages AS language_code

0 commit comments

Comments
 (0)