Skip to content

Commit 03a02fb

Browse files
committed
Move unsupported tests to Verifier
1 parent 6597067 commit 03a02fb

File tree

5 files changed

+69
-112
lines changed

5 files changed

+69
-112
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterSpecIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protected void shouldSkipTest(String testName) throws IOException {
145145
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS.capabilityName()));
146146
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS_V2.capabilityName()));
147147
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_PLANNING_V1.capabilityName()));
148-
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS_V7.capabilityName()));
148+
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS_V8.capabilityName()));
149149
if (testCase.requiredCapabilities.contains(JOIN_LOOKUP_V12.capabilityName())) {
150150
assumeTrue("LOKUP JOIN not supported", supportsIndexModeLookup());
151151
assumeTrue("LOOKUP JOIN not yet supported in CCS", Clusters.localClusterVersion().onOrAfter(Version.fromString("9.2.0")));

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterLookupJoinUnsupportedIT.java

Lines changed: 0 additions & 110 deletions
This file was deleted.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/join/LookupJoin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ private void checkRemoteJoin(Failures failures) {
115115
}
116116
});
117117

118-
fails.forEach(f -> failures.add(fail(this, "LOOKUP JOIN with remote indices can't be executed after " + f)));
118+
fails.forEach(
119+
f -> failures.add(fail(this, "LOOKUP JOIN with remote indices can't be executed after [" + f.text() + "]" + f.source()))
120+
);
121+
119122
}
120123

121124
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTestUtils.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ public static EnrichResolution defaultEnrichResolution() {
184184
"airport_city_boundaries",
185185
"mapping-airport_city_boundaries.json"
186186
);
187+
loadEnrichPolicyResolution(
188+
enrichResolution,
189+
Enrich.Mode.COORDINATOR,
190+
MATCH_TYPE,
191+
"languages_coord",
192+
"language_code",
193+
"languages_idx",
194+
"mapping-languages.json"
195+
);
187196
return enrichResolution;
188197
}
189198

@@ -213,6 +222,25 @@ public static void loadEnrichPolicyResolution(
213222
);
214223
}
215224

225+
public static void loadEnrichPolicyResolution(
226+
EnrichResolution enrich,
227+
Enrich.Mode mode,
228+
String policyType,
229+
String policy,
230+
String field,
231+
String index,
232+
String mapping
233+
) {
234+
IndexResolution indexResolution = loadMapping(mapping, index);
235+
List<String> enrichFields = new ArrayList<>(indexResolution.get().mapping().keySet());
236+
enrichFields.remove(field);
237+
enrich.addResolvedPolicy(
238+
policy,
239+
mode,
240+
new ResolvedEnrichPolicy(field, policyType, enrichFields, Map.of("", index), indexResolution.get().mapping())
241+
);
242+
}
243+
216244
public static void loadEnrichPolicyResolution(EnrichResolution enrich, String policy, String field, String index, String mapping) {
217245
loadEnrichPolicyResolution(enrich, EnrichPolicy.MATCH_TYPE, policy, field, index, mapping);
218246
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,42 @@ public void testFullTextFunctionsInStats() {
22212221
}
22222222
}
22232223

2224+
public void testRemoteLookupJoinWithPipelineBreaker() {
2225+
var analyzer = AnalyzerTestUtils.analyzer(loadMapping("mapping-default.json", "test,remote:test"));
2226+
assertEquals(
2227+
"1:92: LOOKUP JOIN with remote indices can't be executed after [STATS c = COUNT(*) by languages]@1:25",
2228+
error(
2229+
"FROM test,remote:test | STATS c = COUNT(*) by languages "
2230+
+ "| EVAL language_code = languages | LOOKUP JOIN languages_lookup ON language_code",
2231+
analyzer
2232+
)
2233+
);
2234+
2235+
assertEquals(
2236+
"1:72: LOOKUP JOIN with remote indices can't be executed after [SORT emp_no]@1:25",
2237+
error(
2238+
"FROM test,remote:test | SORT emp_no | EVAL language_code = languages | LOOKUP JOIN languages_lookup ON language_code",
2239+
analyzer
2240+
)
2241+
);
2242+
2243+
assertEquals(
2244+
"1:68: LOOKUP JOIN with remote indices can't be executed after [LIMIT 2]@1:25",
2245+
error(
2246+
"FROM test,remote:test | LIMIT 2 | EVAL language_code = languages | LOOKUP JOIN languages_lookup ON language_code",
2247+
analyzer
2248+
)
2249+
);
2250+
assertEquals(
2251+
"1:96: LOOKUP JOIN with remote indices can't be executed after [ENRICH _coordinator:languages_coord]@1:58",
2252+
error(
2253+
"FROM test,remote:test | EVAL language_code = languages | ENRICH _coordinator:languages_coord "
2254+
+ "| LOOKUP JOIN languages_lookup ON language_code",
2255+
analyzer
2256+
)
2257+
);
2258+
}
2259+
22242260
private void checkFullTextFunctionsInStats(String functionInvocation) {
22252261
query("from test | stats c = max(id) where " + functionInvocation, fullTextAnalyzer);
22262262
query("from test | stats c = max(id) where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);

0 commit comments

Comments
 (0)