Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Add support for ES|QL in Data visualizer (elastic#174188)
## Summary This PR adds support for ES|QL queries in Data visualizer. <img width="1695" alt="Screenshot 2024-01-26 at 17 07 59" src="https://github.com/elastic/kibana/assets/43350163/8a54b859-60d6-4c47-b3dd-e5f3ed43b6b0"> <img width="1695" alt="Screenshot 2024-01-26 at 17 12 39" src="https://github.com/elastic/kibana/assets/43350163/32fd08e4-7f3b-43e6-81a7-7ec4e777bac0"> https://github.com/elastic/kibana/assets/43350163/a3f540e9-461d-4ebc-bd69-de4ffa2bc554 ### Changes: - Add a new card from the Data visualizer main page - Add a link from the ML navigation <img width="1717" alt="Screenshot 2024-01-08 at 18 03 50" src="https://github.com/elastic/kibana/assets/43350163/832f7890-4ce6-44c1-ab87-cde01f4bf1c0"> - Added a new button to Use ES|QL <img width="1714" alt="Screenshot 2024-01-09 at 11 23 09" src="https://github.com/elastic/kibana/assets/43350163/a38a9360-6691-4f3b-a824-8481ab543250"> - Support for **keyword**, **text**, **numeric**, **boolean**, **date**, and **ip** fields <img width="1714" alt="Screenshot 2024-01-09 at 11 24 38" src="https://github.com/elastic/kibana/assets/43350163/b122ee5c-1500-4e2b-9434-e64b0b6ea3be"> <img width="1441" alt="Screenshot 2024-01-09 at 11 25 25" src="https://github.com/elastic/kibana/assets/43350163/eb35ee78-8a34-467e-84da-2026b01fcda1"> <img width="969" alt="Screenshot 2024-01-09 at 11 44 02" src="https://github.com/elastic/kibana/assets/43350163/d0f9947d-2b2c-4c14-89ba-9fc5d0a2bf64"> <img width="981" alt="Screenshot 2024-01-10 at 12 01 42" src="https://github.com/elastic/kibana/assets/43350163/aa5a8d44-7447-41fc-a544-d1b626bf8bce"> - Default to user's fieldFormats for fields that are dynamic generated by ES|QL, else use Data view's format - Default to Data view's setting (e.g. type `bytes` in this case for field `bytes_normal_counter`) <img width="1037" alt="Screenshot 2024-01-10 at 12 10 38" src="https://github.com/elastic/kibana/assets/43350163/9fb7e31c-f397-4209-a463-e1a43fe27ffd"> - Default to user's fieldFormats formatting for dynamically generated fields (e.g. type `number` in this case for field `avg_price`) <img width="1283" alt="Screenshot 2024-01-10 at 12 01 03" src="https://github.com/elastic/kibana/assets/43350163/acc25358-50bb-4237-9476-86067ef0badf"> - Add a new UI control to allow users to limit analysis to 5,000 - 10,000 - 100,000 - 1,000,000, rows. This speeds up fetching of the stats for big data sets and avoid potential circuit breaking exceptions. - Break overall stats request into smaller parallel requests (which prevent time out or payload too big due by too many fields), at 10 requests at a time - Break field stats for individual fields into more efficient batches (which prevent time out or payload too big due by too many fields), at 10 requests at at ime - Improve error handling by propagating up the error AND the ES|QL request in both the UI and the developer's console (for better debugging) - Improve error handling in field stats rows: If one field, or a group of fields, say 'keyword' fields fail to fetch for some reasons, it will show error for that field but not affect all other fields. <img width="1690" alt="Screenshot 2024-01-26 at 16 04 28" src="https://github.com/elastic/kibana/assets/43350163/6e240e12-76b4-42d6-b3be-c05342d76df9"> - Add deep linking in the top search bar <img width="1185" alt="Screenshot 2024-01-26 at 16 56 49" src="https://github.com/elastic/kibana/assets/43350163/4f24df68-edc5-41c5-b2ed-d6150ba1e20b"> - More robust support for keyword fields with geo data <img width="1438" alt="Screenshot 2024-01-26 at 16 55 01" src="https://github.com/elastic/kibana/assets/43350163/3b97925b-ca28-4952-8082-8d3242e3cb3f"> ### Todos: - [x] Add earliest/latest for date time fields -> Current blocker: escape special characters in esql variable names - [x] Fix formatting of numbers for dynamic query, where we don't know the formatting based on the data view - [x] Fix date time 'Update' not updating until Refresh is clicked - [x] Better optimization to not fetch distribution & expanded row content for pages that are not visible ### Good to have: - [ ] Investigate bringing back the +/- filter buttons (either by modifying the ES|QL query directly or by adding separate DSL filters?) ------------ ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information