Skip to content

Commit c13556e

Browse files
EQL: Remove "yet" from unsupported pipe error message (elastic#74850) (elastic#74874)
Co-authored-by: Andrei Stefan <[email protected]>
1 parent 60c116e commit c13556e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/LogicalPlanBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060

6161
public abstract class LogicalPlanBuilder extends ExpressionBuilder {
6262

63-
private static final String FILTER_PIPE = "filter", HEAD_PIPE = "head", TAIL_PIPE = "tail";
63+
static final String FILTER_PIPE = "filter", HEAD_PIPE = "head", TAIL_PIPE = "tail";
6464

65-
private static final Set<String> SUPPORTED_PIPES = Sets.newHashSet("count", FILTER_PIPE, HEAD_PIPE, "sort", TAIL_PIPE, "unique",
65+
static final Set<String> SUPPORTED_PIPES = Sets.newHashSet("count", FILTER_PIPE, HEAD_PIPE, "sort", TAIL_PIPE, "unique",
6666
"unique_count");
6767

6868
private final UnresolvedRelation RELATION = new UnresolvedRelation(synthetic("<relation>"), null, "", false, "");
@@ -348,7 +348,7 @@ private LogicalPlan pipe(PipeContext ctx, LogicalPlan plan) {
348348
return new Tail(source(ctx), tailLimit, plan);
349349

350350
default:
351-
throw new ParsingException(source(ctx), "Pipe [{}] is not supported yet", name);
351+
throw new ParsingException(source(ctx), "Pipe [{}] is not supported", name);
352352
}
353353
}
354354

x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ExpressionTests.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@
3434
import java.util.List;
3535

3636
import static org.elasticsearch.xpack.eql.parser.AbstractBuilder.unquoteString;
37+
import static org.elasticsearch.xpack.eql.parser.LogicalPlanBuilder.HEAD_PIPE;
38+
import static org.elasticsearch.xpack.eql.parser.LogicalPlanBuilder.SUPPORTED_PIPES;
39+
import static org.elasticsearch.xpack.eql.parser.LogicalPlanBuilder.TAIL_PIPE;
3740
import static org.elasticsearch.xpack.ql.TestUtils.UTC;
41+
import static org.hamcrest.Matchers.endsWith;
3842
import static org.hamcrest.Matchers.equalTo;
3943
import static org.hamcrest.Matchers.instanceOf;
4044
import static org.hamcrest.Matchers.is;
@@ -509,4 +513,11 @@ public void testChainedComparisonsDisallowed() {
509513
+ "'regex', 'regex~', ':', '+', '-', '*', '/', '%', '.', '['}",
510514
e.getMessage());
511515
}
516+
517+
public void testUnsupportedPipes() {
518+
String pipe = randomValueOtherThanMany(Arrays.asList(HEAD_PIPE, TAIL_PIPE)::contains, () -> randomFrom(SUPPORTED_PIPES));
519+
ParsingException pe = expectThrows(ParsingException.class, "Expected parsing exception",
520+
() -> parser.createStatement("process where foo == true | " + pipe));
521+
assertThat(pe.getMessage(), endsWith("Pipe [" + pipe + "] is not supported"));
522+
}
512523
}

0 commit comments

Comments
 (0)