-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
QL: wildcard field type support #58062
Conversation
Pinging @elastic/es-ql (:Query Languages/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.
Looks good! Left some minor comments.
Also:
- Can we have some Jdbc (PreparedStatement set() and ResultSet get()) tests.
- Is it safe to merge it for 7.9 without the JDBC compatibility tests in place?
@@ -32,7 +33,9 @@ | |||
if (doc.containsKey(fieldName)) { | |||
ScriptDocValues<T> docValues = doc.get(fieldName); | |||
if (!docValues.isEmpty()) { | |||
return docValues.get(0); | |||
T value = docValues.get(0); | |||
// FIXME temporary workaround until https://github.com/elastic/elasticsearch/issues/58044 gets fixed |
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.
The issues seems fixed, can you remove the workaround?
; | ||
|
||
|
||
singlePercentile |
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.
Wouldn't groupBy
be more appropriate?
Bezalel Simmel |10002.0 | ||
; | ||
|
||
complexPercentile |
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.
and here complexGroupBy
?
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.
LGTM. I too am concern about the lack of backwards compatibility...
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.
LGTM, except for the compatibility bit.
Generally looking at it, the new type doesn't seem to have an echo in the SQL functionality itself (much like constant-keyword
vs keyword
): are the three types distinguishable at SQL level, characteristics- and behavior- or restrictions-wise? B/c if they aren't, while strictly conceptually different types should indeed be reported, I'm wondering if we could compromise to ease the backwards compatibility restrains.
Currently blocked by: #56722 |
There is ongoing work on this front. |
When the work in #53175 is done, this PR is not needed anymore. Also, CONSTANT_KEYWORD data type will also have to be removed from QL. |
See #58315 as well. |
@costin this PR has been updated after those PRs have been merged and now it contains only test code with the |
@@ -48,8 +48,12 @@ | |||
|
|||
private static DataType getType(DataTypeRegistry typeRegistry, Map<String, Object> content) { | |||
if (content.containsKey("type")) { | |||
String typeName = content.get("type").toString(); | |||
if ("wildcard".equals(typeName)) { |
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 is this needed? Aren't wildcard returned as keywords? Or is this using a different API/source?
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.
That's for testing. We use .json files having an index' complete mapping (see org.elasticsearch.xpack.ql.type.TypesTests
) and the wildcard
comparison is for bypassing SQL's and EQL's specific data types auto-resolver in the specific case of wildcard
.
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.
LGTM
(cherry picked from commit c874e6c)
(cherry picked from commit c874e6c)
This PR adds support for
wildcard
data type following its addition in Elasticsearch with #49993.There is one issue that will need to be addressed afterwards: there is a slightly different behavior between
wildcard
and the other text based data types (iekeyword
) when it comes to Painless scripting. As soon as #58044 is fixed, the workaround inInternalQlScriptUtils
needs to be reverted.Addresses #54184.