-
Notifications
You must be signed in to change notification settings - Fork 25.3k
EQL: Add ? param support #52301
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
EQL: Add ? param support #52301
Conversation
Pinging @elastic/es-search (:Search/EQL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left few comments.
Also, since ?
has other meaning in the grammar, as well, I would like to see a test that contains both uses of ?
. For example:
assertEquals(expr("a == ?\"String with literal 'slash' \\ characters included\" and b == ? or c == ?", Arrays.asList("test", false)),
expr("a == ?\"String with literal 'slash' \\ characters included\" and b == 'test' or c == false"));
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ParameterTests.java
Show resolved
Hide resolved
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ParameterTests.java
Show resolved
Hide resolved
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ParameterTests.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ParameterTests.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ParameterTests.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/ParameterTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments - more tests are needed to check that not only the param get replaced but also that tricky strings are properly added in the query.
|
||
|
||
public class ExpressionBuilder extends IdentifierBuilder { | ||
|
||
protected final ParserParams params; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why protected and not private?
x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/ExpressionBuilder.java
Outdated
Show resolved
Hide resolved
@elastic/es-ql |
After searching around regarding query params in SQL DBs, I saw that |
Relates to #51756 (closed with API support)
Add support for
?
params to EQL. This hasn't been integrated/tested with for the API, but that can be added here easily if this is the right PR for that.