Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.13] EQL: Remove "yet" from unsupported pipe error message (#74850) #74874

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@

public abstract class LogicalPlanBuilder extends ExpressionBuilder {

private static final String FILTER_PIPE = "filter", HEAD_PIPE = "head", TAIL_PIPE = "tail";
static final String FILTER_PIPE = "filter", HEAD_PIPE = "head", TAIL_PIPE = "tail";

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

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

default:
throw new ParsingException(source(ctx), "Pipe [{}] is not supported yet", name);
throw new ParsingException(source(ctx), "Pipe [{}] is not supported", name);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
import java.util.List;

import static org.elasticsearch.xpack.eql.parser.AbstractBuilder.unquoteString;
import static org.elasticsearch.xpack.eql.parser.LogicalPlanBuilder.HEAD_PIPE;
import static org.elasticsearch.xpack.eql.parser.LogicalPlanBuilder.SUPPORTED_PIPES;
import static org.elasticsearch.xpack.eql.parser.LogicalPlanBuilder.TAIL_PIPE;
import static org.elasticsearch.xpack.ql.TestUtils.UTC;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
Expand Down Expand Up @@ -509,4 +513,11 @@ public void testChainedComparisonsDisallowed() {
+ "'regex', 'regex~', ':', '+', '-', '*', '/', '%', '.', '['}",
e.getMessage());
}

public void testUnsupportedPipes() {
String pipe = randomValueOtherThanMany(Arrays.asList(HEAD_PIPE, TAIL_PIPE)::contains, () -> randomFrom(SUPPORTED_PIPES));
ParsingException pe = expectThrows(ParsingException.class, "Expected parsing exception",
() -> parser.createStatement("process where foo == true | " + pipe));
assertThat(pe.getMessage(), endsWith("Pipe [" + pipe + "] is not supported"));
}
}