ESQL: Union Types Support (take1)#106885
Closed
craigtaverner wants to merge 2 commits intoelastic:mainfrom
Closed
Conversation
Collaborator
|
Hi @craigtaverner, I've created a changelog YAML for you. |
If the query sources multiple indexes, and the same field exists in multiple indexes with different types, this would normally fail the query. However, if the query includes a conversion function to resolve the field to a single type before it is used in other functions or aggregations, then this should work. The following query works in this first prototype: ``` FROM sample_data* | EVAL client_ip = TO_IP(client_ip) | STATS count=count(*) BY client_ip | SORT count DESC, client_ip ASC | KEEP count, client_ip ``` The client_ip field is an `IP` in the `sample_data` index, but a `keyword` in the `sample_data_str` index. Before the aggregation can work, we need to covert all `client_ip` fields into `IP` type.
c3fe640 to
41a4afb
Compare
14 tasks
Collaborator
|
Hi @craigtaverner, I've created a changelog YAML for you. |
Contributor
Author
|
We're focusing on the second prototype now: #107255 |
21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the query sources multiple indexes, and the same field exists in multiple indexes with different types, this would normally fail the query. However, if the query includes a conversion function to resolve the field to a single type before it is used in other functions or aggregations, then this should work.
The following query works in this first prototype:
The client_ip field is an
IPin thesample_dataindex, but akeywordin thesample_data_strindex. Before the aggregation can work, we need to covert allclient_ipfields intoIPtype.Fixes #100603