Skip to content

Commit

Permalink
Use new unique join_lookup_v4 EsqlCapability
Browse files Browse the repository at this point in the history
And re-enable one disabled test
  • Loading branch information
craigtaverner committed Dec 2, 2024
1 parent e64c34a commit ca9c827
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import static org.elasticsearch.xpack.esql.EsqlTestUtils.classpathResources;
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS;
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS_V2;
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V3;
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V4;
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_PLANNING_V1;
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.METADATA_FIELDS_REMOTE_TEST;
import static org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase.Mode.SYNC;
Expand Down Expand Up @@ -125,7 +125,7 @@ protected void shouldSkipTest(String testName) throws IOException {
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS.capabilityName()));
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS_V2.capabilityName()));
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_PLANNING_V1.capabilityName()));
assumeFalse("LOOKUP JOIN not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_LOOKUP_V3.capabilityName()));
assumeFalse("LOOKUP JOIN not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_LOOKUP_V4.capabilityName()));
}

private TestFeatureService remoteFeaturesService() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

//TODO: this sometimes returns null instead of the looked up value (likely related to the execution order)
basicOnTheDataNode
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM employees
| EVAL language_code = languages
Expand All @@ -22,7 +22,7 @@ emp_no:integer | language_code:integer | language_name:keyword
;

basicRow
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW language_code = 1
| LOOKUP JOIN languages_lookup ON language_code
Expand All @@ -33,7 +33,7 @@ language_code:integer | language_name:keyword
;

basicOnTheCoordinator
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM employees
| SORT emp_no
Expand All @@ -49,9 +49,8 @@ emp_no:integer | language_code:integer | language_name:keyword
10003 | 4 | German
;

//TODO: this sometimes returns null instead of the looked up value (likely related to the execution order)
subsequentEvalOnTheDataNode-Ignore
required_capability: join_lookup_v3
subsequentEvalOnTheDataNode
required_capability: join_lookup_v4

FROM employees
| EVAL language_code = languages
Expand All @@ -69,7 +68,7 @@ emp_no:integer | language_code:integer | language_name:keyword | language_code_x
;

subsequentEvalOnTheCoordinator
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM employees
| SORT emp_no
Expand All @@ -87,7 +86,7 @@ emp_no:integer | language_code:integer | language_name:keyword | language_code_x
;

lookupIPFromRow
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW left = "left", client_ip = "172.21.0.5", right = "right"
| LOOKUP JOIN clientips_lookup ON client_ip
Expand All @@ -98,7 +97,7 @@ left | 172.21.0.5 | right | Development
;

lookupIPFromRowWithShadowing
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW left = "left", client_ip = "172.21.0.5", env = "env", right = "right"
| LOOKUP JOIN clientips_lookup ON client_ip
Expand All @@ -109,7 +108,7 @@ left | 172.21.0.5 | right | Development
;

lookupIPFromRowWithShadowingKeep
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW left = "left", client_ip = "172.21.0.5", env = "env", right = "right"
| EVAL client_ip = client_ip::keyword
Expand All @@ -122,7 +121,7 @@ left | 172.21.0.5 | right | Development
;

lookupIPFromIndex
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| EVAL client_ip = client_ip::keyword
Expand All @@ -140,7 +139,7 @@ FROM sample_data
;

lookupIPFromIndexKeep
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| EVAL client_ip = client_ip::keyword
Expand All @@ -159,7 +158,7 @@ FROM sample_data
;

lookupIPFromIndexStats
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| EVAL client_ip = client_ip::keyword
Expand All @@ -175,7 +174,7 @@ count:long | env:keyword
;

lookupIPFromIndexStatsKeep
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| EVAL client_ip = client_ip::keyword
Expand All @@ -192,7 +191,7 @@ count:long | env:keyword
;

lookupMessageFromRow
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW left = "left", message = "Connected to 10.1.0.1", right = "right"
| LOOKUP JOIN message_types_lookup ON message
Expand All @@ -203,7 +202,7 @@ left | Connected to 10.1.0.1 | right | Success
;

lookupMessageFromRowWithShadowing
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW left = "left", message = "Connected to 10.1.0.1", type = "unknown", right = "right"
| LOOKUP JOIN message_types_lookup ON message
Expand All @@ -214,7 +213,7 @@ left | Connected to 10.1.0.1 | right | Success
;

lookupMessageFromRowWithShadowingKeep
required_capability: join_lookup_v3
required_capability: join_lookup_v4

ROW left = "left", message = "Connected to 10.1.0.1", type = "unknown", right = "right"
| LOOKUP JOIN message_types_lookup ON message
Expand All @@ -226,7 +225,7 @@ left | Connected to 10.1.0.1 | right | Success
;

lookupMessageFromIndex
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| LOOKUP JOIN message_types_lookup ON message
Expand All @@ -243,7 +242,7 @@ FROM sample_data
;

lookupMessageFromIndexKeep
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| LOOKUP JOIN message_types_lookup ON message
Expand All @@ -261,7 +260,7 @@ FROM sample_data
;

lookupMessageFromIndexStats
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| LOOKUP JOIN message_types_lookup ON message
Expand All @@ -276,7 +275,7 @@ count:long | type:keyword
;

lookupMessageFromIndexStatsKeep
required_capability: join_lookup_v3
required_capability: join_lookup_v4

FROM sample_data
| LOOKUP JOIN message_types_lookup ON message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public enum Cap {
/**
* LOOKUP JOIN
*/
JOIN_LOOKUP_V3(Build.current().isSnapshot()),
JOIN_LOOKUP_V4(Build.current().isSnapshot()),

/**
* Fix for https://github.com/elastic/elasticsearch/issues/117054
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public final void test() throws Throwable {
);
assumeFalse(
"lookup join disabled for csv tests",
testCase.requiredCapabilities.contains(EsqlCapabilities.Cap.JOIN_LOOKUP_V3.capabilityName())
testCase.requiredCapabilities.contains(EsqlCapabilities.Cap.JOIN_LOOKUP_V4.capabilityName())
);
if (Build.current().isSnapshot()) {
assertThat(
Expand Down

0 comments on commit ca9c827

Please sign in to comment.