-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] Supports counter fields in Discover sidebar #186154
Conversation
Pinging @elastic/kibana-esql (Team:ESQL) |
/ci |
The changes works great in Discover ES|QL! I wonder how it would affect other parts of Kibana. Currently, for data view fields the code relies on What if we create a helper function which would convert an ES|QL column into a |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Page load bundle
To update your PR or re-run it, just comment with: |
@jughosta I didn't know about that, thanx. As we unfortunately rely on dataviews what you are proposing makes sense but I am not 100% certain I understand the implementation. I will close this PR and I created a new issue to track your proposal #186160. It will be better if someone from the team would help here as I am not 100% certain of how this will work but I would love to see a PoC. @kertal and @davismcphee could you possibly prioritize it? 🙏 |
@stratoula just a heads up that it looks like @jughosta has been looking into this here: #186292. |
Fantastic ❤️ |
- Closes #186160 ## Summary This PR adds a new util to help with converting ES|QL column into data view field representation https://github.com/elastic/kibana/blob/9d63332c74523b00f2b9056352a5b3a86eaf2b75/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field.ts#L13 This allows to handle counter fields in a more predicable way despite of the different format of ES|QL column data. #186154 (comment) <img width="1988" alt="Screenshot 2024-07-03 at 13 48 20" src="https://github.com/elastic/kibana/assets/1415710/14ce9cd8-8a02-4f3c-8845-c19c30079a75"> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Matthias Wilhelm <[email protected]>
- Closes elastic#186160 ## Summary This PR adds a new util to help with converting ES|QL column into data view field representation https://github.com/elastic/kibana/blob/9d63332c74523b00f2b9056352a5b3a86eaf2b75/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field.ts#L13 This allows to handle counter fields in a more predicable way despite of the different format of ES|QL column data. elastic#186154 (comment) <img width="1988" alt="Screenshot 2024-07-03 at 13 48 20" src="https://github.com/elastic/kibana/assets/1415710/14ce9cd8-8a02-4f3c-8845-c19c30079a75"> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Matthias Wilhelm <[email protected]> (cherry picked from commit 692b656)
# Backport This will backport the following commits from `main` to `8.15`: - [[ES|QL] Support counter fields (#186292)](#186292) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-09T10:32:48Z","message":"[ES|QL] Support counter fields (#186292)\n\n- Closes https://github.com/elastic/kibana/issues/186160\r\n\r\n## Summary\r\n\r\nThis PR adds a new util to help with converting ES|QL column into data\r\nview field representation\r\nhttps://github.com/elastic/kibana/blob/9d63332c74523b00f2b9056352a5b3a86eaf2b75/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field.ts#L13\r\n\r\nThis allows to handle counter fields in a more predicable way despite of\r\nthe different format of ES|QL column data.\r\nhttps://github.com//pull/186154#issuecomment-2164973060\r\n\r\n<img width=\"1988\" alt=\"Screenshot 2024-07-03 at 13 48 20\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/14ce9cd8-8a02-4f3c-8845-c19c30079a75\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Matthias Wilhelm <[email protected]>","sha":"692b656f9c247b438951a946f3f1123d36ac00a6","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:DataDiscovery","backport:prev-minor","Feature:ES|QL","v8.16.0"],"title":"[ES|QL] Support counter fields","number":186292,"url":"https://github.com/elastic/kibana/pull/186292","mergeCommit":{"message":"[ES|QL] Support counter fields (#186292)\n\n- Closes https://github.com/elastic/kibana/issues/186160\r\n\r\n## Summary\r\n\r\nThis PR adds a new util to help with converting ES|QL column into data\r\nview field representation\r\nhttps://github.com/elastic/kibana/blob/9d63332c74523b00f2b9056352a5b3a86eaf2b75/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field.ts#L13\r\n\r\nThis allows to handle counter fields in a more predicable way despite of\r\nthe different format of ES|QL column data.\r\nhttps://github.com//pull/186154#issuecomment-2164973060\r\n\r\n<img width=\"1988\" alt=\"Screenshot 2024-07-03 at 13 48 20\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/14ce9cd8-8a02-4f3c-8845-c19c30079a75\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Matthias Wilhelm <[email protected]>","sha":"692b656f9c247b438951a946f3f1123d36ac00a6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/186292","number":186292,"mergeCommit":{"message":"[ES|QL] Support counter fields (#186292)\n\n- Closes https://github.com/elastic/kibana/issues/186160\r\n\r\n## Summary\r\n\r\nThis PR adds a new util to help with converting ES|QL column into data\r\nview field representation\r\nhttps://github.com/elastic/kibana/blob/9d63332c74523b00f2b9056352a5b3a86eaf2b75/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field.ts#L13\r\n\r\nThis allows to handle counter fields in a more predicable way despite of\r\nthe different format of ES|QL column data.\r\nhttps://github.com//pull/186154#issuecomment-2164973060\r\n\r\n<img width=\"1988\" alt=\"Screenshot 2024-07-03 at 13 48 20\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/14ce9cd8-8a02-4f3c-8845-c19c30079a75\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Matthias Wilhelm <[email protected]>","sha":"692b656f9c247b438951a946f3f1123d36ac00a6"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <[email protected]>
Summary
In 8.14 we added partial support of counter fields (you have to convert them to long first to use) but in the sidebar they were reported as unknown.
This PR asserts the correct kibana type for these fields.
The fields statistics still dont work for this field but I am tracking this work here #186077