QL: case sensitive support in EQL#56404
Conversation
* Added case sensitivity to EQL configuration * case_sensitive parameter can be specified when running queries (default is case insensitive) * Added STARTS_WITH function to SQL as well
…o 55340_enhancement3
…o 55340_enhancement3
|
Pinging @elastic/es-ql (:Query Languages/EQL) |
matriv
left a comment
There was a problem hiding this comment.
Looks good, left some comments mostly minor.
.../src/main/java/org/elasticsearch/xpack/eql/expression/function/scalar/string/StartsWith.java
Show resolved
Hide resolved
x-pack/plugin/eql/src/main/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt
Show resolved
Hide resolved
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/analysis/VerifierTests.java
Outdated
Show resolved
Hide resolved
...rg/elasticsearch/xpack/ql/expression/function/scalar/string/StartsWithFunctionPipeTests.java
Show resolved
Hide resolved
x-pack/plugin/sql/src/main/resources/org/elasticsearch/xpack/sql/plugin/sql_whitelist.txt
Show resolved
Hide resolved
| private final boolean isCaseSensitive; | ||
|
|
||
| public StartsWithFunctionProcessor(Processor source, Processor pattern) { | ||
| public StartsWithFunctionProcessor(Processor source, Processor pattern, boolean isCaseSensitive) { |
There was a problem hiding this comment.
Maybe remove the Function as we don't normally use it in processor names.
There was a problem hiding this comment.
There are functions where this pattern is used - String functions.
| @@ -17,13 +17,15 @@ | |||
|
|
|||
| public class StartsWithFunctionPipe extends Pipe { | |||
There was a problem hiding this comment.
Maybe remove Function from the name.
x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryFolderOkTests.java
Show resolved
Hide resolved
costin
left a comment
There was a problem hiding this comment.
Left a few comments but looks good to me otherwise.
Thanks for the various cleanups.
| import org.elasticsearch.xpack.sql.planner.Planner; | ||
| import org.elasticsearch.xpack.sql.planner.PlanningException; | ||
| import org.elasticsearch.xpack.sql.proto.SqlTypedParamValue; | ||
| import org.elasticsearch.xpack.sql.session.Configuration; |
There was a problem hiding this comment.
What's the advantage of using Configuration instead of SqlConfiguration?
There was a problem hiding this comment.
This is just a rename. The SQL's Configuration => SqlConfiguration.
The same for Eql. EQL's Configuration was renamed to EqlConfiguration.
I found it a bit confusing to have Configuration in three separate projects.
...org/elasticsearch/xpack/sql/expression/function/scalar/NoArgumentsConfigurationFunction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/session/EqlSession.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/eql/expression/function/scalar/string/StartsWith.java
Show resolved
Hide resolved
…o 55340_enhancement3
matriv
left a comment
There was a problem hiding this comment.
LGTM. left 2 minor formatting comments.
| pipe(((Expression) randomValueOtherThan(f.field(), () -> randomStringLiteral()))), | ||
| pipe(((Expression) randomValueOtherThan(f.pattern(), () -> randomStringLiteral()))), | ||
| f.isCaseSensitive())); | ||
| for(int i = 1; i < 4; i++) { |
There was a problem hiding this comment.
| for(int i = 1; i < 4; i++) { | |
| for (int i = 1; i < 4; i++) { |
| pipe(((Expression) randomValueOtherThan(f.pattern(), () -> randomStringLiteral()))), | ||
| f.isCaseSensitive())); | ||
| for(int i = 1; i < 4; i++) { | ||
| for(BitSet comb : new Combinations(3, i)) { |
There was a problem hiding this comment.
| for(BitSet comb : new Combinations(3, i)) { | |
| for (BitSet comb : new Combinations(3, i)) { |
* adds a generic startsWith function to QL * modifies the existent EQL startsWith function to be case sensitive aware * improves the existent EQL startsWith function to use a prefix query when the function is used in a case sensitive context. Same improvement is used in SQL's newly added STARTS_WITH function. * adds case sensitivity to EQL configuration through a case_sensitive parameter in the eql request, as established in elastic#54411. The case_sensitive parameter can be specified when running queries (default is case insensitive) (cherry picked from commit ee5a09e)
* QL: case sensitive support in EQL (#56404) * adds a generic startsWith function to QL * modifies the existent EQL startsWith function to be case sensitive aware * improves the existent EQL startsWith function to use a prefix query when the function is used in a case sensitive context. Same improvement is used in SQL's newly added STARTS_WITH function. * adds case sensitivity to EQL configuration through a case_sensitive parameter in the eql request, as established in #54411. The case_sensitive parameter can be specified when running queries (default is case insensitive) (cherry picked from commit ee5a09e)
This PR adds several enhancements:
prefixquery when the function is used in a case sensitive context. Same improvement is used in SQL's newly added STARTS_WITH function.case_sensitiveparameter in the eql request, as established in EQL: case sensitivity in ES EQL string functions #54411. Thecase_sensitiveparameter can be specified when running queries (default is case insensitive)What this PR is not covering:
Fixes #55340.
Relates to #54411.