-
Notifications
You must be signed in to change notification settings - Fork 25.2k
ESQL: Fix alias removal in regex extraction with JOIN
#127687
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
Changes from all commits
f33b994
b42cf9f
0655294
10b7991
3439f1f
ed1074e
3ab5965
cbe265d
6c700a8
044d3fa
31c2b2c
057a8a1
d56383b
440421d
3af81d5
ba02e1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 127687 | ||
summary: "ESQL: Fix alias removal in regex extraction with JOIN" | ||
area: ES|QL | ||
type: bug | ||
issues: | ||
- 127467 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1673,3 +1673,72 @@ null | Milky Way | Marunouchi | |
null | null | null | ||
null | null | null | ||
; | ||
|
||
|
||
joinMaskingRegex | ||
// https://github.com/elastic/elasticsearch/issues/127467 | ||
required_capability: union_types | ||
required_capability: join_lookup_v12 | ||
required_capability: fix_join_masking_regex_extract | ||
from books,message_*,ul* | ||
| enrich languages_policy on status | ||
| drop `language_name`, `bytes_out`, `id`, id | ||
| dissect book_no "%{type}" | ||
| dissect author.keyword "%{HZicfARaID}" | ||
| mv_expand `status` | ||
| sort HZicfARaID, year DESC NULLS LAST, publisher DESC NULLS FIRST, description DESC, type NULLS LAST, message ASC NULLS LAST, title NULLS FIRST, status NULLS LAST | ||
| enrich languages_policy on book_no | ||
| grok message "%{WORD:DiLNyZKNDu}" | ||
| limit 7972 | ||
| rename year as language_code | ||
| lookup join languages_lookup on language_code | ||
| limit 13966 | ||
| stats rcyIZnSOb = min(language_code), `ratings` = min(@timestamp), dgDxwMeFYrD = count(`@timestamp`), ifyZfXigqVN = count(*), qTXdrzSpY = min(language_code) by author.keyword | ||
| rename author.keyword as message | ||
| lookup join message_types_lookup on message | ||
| stats `ratings` = count(*) by type | ||
| stats `type` = count(type), `ratings` = count(*) | ||
| keep `ratings`, ratings | ||
; | ||
|
||
ratings:long | ||
1 | ||
; | ||
|
||
joinMaskingDissect | ||
// https://github.com/elastic/elasticsearch/issues/127467 | ||
required_capability: join_lookup_v12 | ||
required_capability: fix_join_masking_regex_extract | ||
from sample_data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add this test and the one below in IndexResolverFieldNamesTests as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you missed this request here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry! I misunderstood what you meant. I was actually thinking about adding comments of links to the original issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added in d56383b |
||
| dissect message "%{type}" | ||
| drop type | ||
| lookup join message_types_lookup on message | ||
| stats count = count(*) by type | ||
| keep count | ||
| sort count | ||
; | ||
count:long | ||
1 | ||
3 | ||
3 | ||
; | ||
|
||
|
||
joinMaskingGrok | ||
// https://github.com/elastic/elasticsearch/issues/127467 | ||
required_capability: join_lookup_v12 | ||
required_capability: fix_join_masking_regex_extract | ||
from sample_data | ||
| grok message "%{WORD:type}" | ||
| drop type | ||
| lookup join message_types_lookup on message | ||
| stats max = max(event_duration) by type | ||
| keep max | ||
| sort max | ||
; | ||
|
||
max:long | ||
1232382 | ||
3450233 | ||
8268153 | ||
; |
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 am not a big fan of having such test queries here. At least, add a comment with the link to the original bug report.