|
17 | 17 | import org.elasticsearch.index.IndexMode; |
18 | 18 | import org.elasticsearch.transport.RemoteClusterAware; |
19 | 19 | import org.elasticsearch.xpack.core.enrich.EnrichPolicy; |
| 20 | +import org.elasticsearch.xpack.esql.capabilities.PostAnalysisPlanVerificationAware; |
20 | 21 | import org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware; |
21 | | -import org.elasticsearch.xpack.esql.capabilities.PostOptimizationVerificationAware; |
22 | 22 | import org.elasticsearch.xpack.esql.capabilities.TelemetryAware; |
23 | 23 | import org.elasticsearch.xpack.esql.common.Failures; |
24 | 24 | import org.elasticsearch.xpack.esql.core.capabilities.Resolvables; |
|
55 | 55 | public class Enrich extends UnaryPlan |
56 | 56 | implements |
57 | 57 | GeneratingPlan<Enrich>, |
58 | | - PostOptimizationVerificationAware, |
| 58 | + PostAnalysisPlanVerificationAware, |
59 | 59 | PostAnalysisVerificationAware, |
60 | 60 | TelemetryAware, |
61 | | - SortAgnostic, |
62 | | - ExecutesOn { |
| 61 | + SortAgnostic { |
63 | 62 | public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry( |
64 | 63 | LogicalPlan.class, |
65 | 64 | "Enrich", |
@@ -332,7 +331,7 @@ private static void checkForPlansForbiddenBeforeRemoteEnrich(Enrich enrich, Fail |
332 | 331 | } |
333 | 332 | }); |
334 | 333 |
|
335 | | - fails.forEach(f -> failures.add(fail(this, "ENRICH with remote policy can't be executed after [" + f.text() + "]" + f.source()))); |
| 334 | + badCommands.forEach(c -> failures.add(fail(enrich, "ENRICH with remote policy can't be executed after " + c))); |
336 | 335 | } |
337 | 336 |
|
338 | 337 | /** |
@@ -364,11 +363,4 @@ public void postAnalysisVerification(Failures failures) { |
364 | 363 | } |
365 | 364 |
|
366 | 365 | } |
367 | | - |
368 | | - @Override |
369 | | - public void postOptimizationVerification(Failures failures) { |
370 | | - if (this.mode == Mode.REMOTE) { |
371 | | - checkForPlansForbiddenBeforeRemoteEnrich(failures); |
372 | | - } |
373 | | - } |
374 | 366 | } |
0 commit comments