-
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
[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries #200583
[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries #200583
Conversation
@@ -609,13 +606,17 @@ export class LensVisService { | |||
}): Suggestion[] => { | |||
const { dataView, columns, query, isPlainRecord } = queryParams; | |||
|
|||
if (!isPlainRecord || !isOfAggregateQueryType(query)) { |
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.
Code style updates. Same logic.
timeRange && | ||
isOfAggregateQueryType(query) && | ||
!hasTransformationalCommand(query.esql) | ||
) { |
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.
Code style updates. Same logic.
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.
Removed this wrapper-function
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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.
Code changes look good and it works as expected. Thanks for fixing it!
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.
This looks great Julia thanx for taking care of it!
I twitched the labels a bit to backport in 8.17 too
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.
Thx @jughosta for fixing this so quickly 🙏 , just tested the many_fields
index again, no more chart rendered, no more performance issues.
One question: I think this should be labeled as a fix, shouldn't it?
@kertal totally, I update the release label |
💛 Build succeeded, but was flaky
Failed CI StepsTest FailuresMetrics [docs]Module Count
Async chunks
History
cc @jughosta |
Yes, thanks for the review and updating the labels! |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7457[✅] test/functional/apps/discover/group3/config.ts: 25/25 tests passed. |
Starting backport for target branches: 8.17, 8.x https://github.com/elastic/kibana/actions/runs/11953911168 |
…and non-time-based ES|QL queries (elastic#200583) - Closes elastic#199608 ## Summary This PR changes the logic around when suggestions from lens API are used. Previously for non-transformational query and non-time-based data it would try to render one of lens suggestions supplying chart data via `table` prop. Now, it would not render any chart. Before: - Data view mode => Static histogram configuration - ES|QL mode and non-transformational query => _**Gets lens suggestions.**_ If histogram chart is not possible, **_takes the first lens suggestion for rendering the chart_** - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. After: - Data view mode => Static histogram configuration (same) - ES|QL mode and non-transformational query => ~~_**Gets lens suggestions.**_~~ If histogram chart is not possible, **_renders nothing_** (updated) - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. (same) ### Testing As per originally reported case: 1. `node scripts/es_archiver --kibana-url=http://elastic:changeme@localhost:5601 --es-url=http://elastic:changeme@localhost:9200 load test/functional/fixtures/es_archiver/many_fields` 2. Navigate to Discover, switch to ES|QL mode and enter `FROM indices-stats | LIMIT 10` 3. No chart is expected. Also there should be no regression for elastic#195863 ### Checklist - [x] [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 --------- Co-authored-by: Davis McPhee <davis.mcphee@elastic.co> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> (cherry picked from commit b9439e6)
…and non-time-based ES|QL queries (elastic#200583) - Closes elastic#199608 ## Summary This PR changes the logic around when suggestions from lens API are used. Previously for non-transformational query and non-time-based data it would try to render one of lens suggestions supplying chart data via `table` prop. Now, it would not render any chart. Before: - Data view mode => Static histogram configuration - ES|QL mode and non-transformational query => _**Gets lens suggestions.**_ If histogram chart is not possible, **_takes the first lens suggestion for rendering the chart_** - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. After: - Data view mode => Static histogram configuration (same) - ES|QL mode and non-transformational query => ~~_**Gets lens suggestions.**_~~ If histogram chart is not possible, **_renders nothing_** (updated) - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. (same) ### Testing As per originally reported case: 1. `node scripts/es_archiver --kibana-url=http://elastic:changeme@localhost:5601 --es-url=http://elastic:changeme@localhost:9200 load test/functional/fixtures/es_archiver/many_fields` 2. Navigate to Discover, switch to ES|QL mode and enter `FROM indices-stats | LIMIT 10` 3. No chart is expected. Also there should be no regression for elastic#195863 ### Checklist - [x] [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 --------- Co-authored-by: Davis McPhee <davis.mcphee@elastic.co> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> (cherry picked from commit b9439e6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ional and non-time-based ES|QL queries (#200583) (#201185) # Backport This will backport the following commits from `main` to `8.x`: - [[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)](#200583) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-11-21T13:10:21Z","message":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)\n\n- Closes https://github.com/elastic/kibana/issues/199608\r\n\r\n## Summary\r\n\r\nThis PR changes the logic around when suggestions from lens API are\r\nused. Previously for non-transformational query and non-time-based data\r\nit would try to render one of lens suggestions supplying chart data via\r\n`table` prop. Now, it would not render any chart.\r\n\r\nBefore:\r\n- Data view mode => Static histogram configuration\r\n- ES|QL mode and non-transformational query => _**Gets lens\r\nsuggestions.**_ If histogram chart is not possible, **_takes the first\r\nlens suggestion for rendering the chart_**\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart.\r\n\r\nAfter:\r\n- Data view mode => Static histogram configuration (same)\r\n- ES|QL mode and non-transformational query => ~~_**Gets lens\r\nsuggestions.**_~~ If histogram chart is not possible, **_renders\r\nnothing_** (updated)\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart. (same)\r\n\r\n### Testing\r\n\r\nAs per originally reported case:\r\n1. `node scripts/es_archiver\r\n--kibana-url=http://elastic:changeme@localhost:5601\r\n--es-url=http://elastic:changeme@localhost:9200 load\r\ntest/functional/fixtures/es_archiver/many_fields`\r\n\r\n2. Navigate to Discover, switch to ES|QL mode and enter `FROM\r\nindices-stats | LIMIT 10`\r\n3. No chart is expected.\r\n\r\nAlso there should be no regression for\r\nhttps://github.com//pull/195863\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"b9439e658d5cca8dd89f7b3d7cc399c72e4e5103","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:DataDiscovery","Feature:ES|QL","backport:version","v8.17.0","v8.18.0"],"title":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries","number":200583,"url":"https://github.com/elastic/kibana/pull/200583","mergeCommit":{"message":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)\n\n- Closes https://github.com/elastic/kibana/issues/199608\r\n\r\n## Summary\r\n\r\nThis PR changes the logic around when suggestions from lens API are\r\nused. Previously for non-transformational query and non-time-based data\r\nit would try to render one of lens suggestions supplying chart data via\r\n`table` prop. Now, it would not render any chart.\r\n\r\nBefore:\r\n- Data view mode => Static histogram configuration\r\n- ES|QL mode and non-transformational query => _**Gets lens\r\nsuggestions.**_ If histogram chart is not possible, **_takes the first\r\nlens suggestion for rendering the chart_**\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart.\r\n\r\nAfter:\r\n- Data view mode => Static histogram configuration (same)\r\n- ES|QL mode and non-transformational query => ~~_**Gets lens\r\nsuggestions.**_~~ If histogram chart is not possible, **_renders\r\nnothing_** (updated)\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart. (same)\r\n\r\n### Testing\r\n\r\nAs per originally reported case:\r\n1. `node scripts/es_archiver\r\n--kibana-url=http://elastic:changeme@localhost:5601\r\n--es-url=http://elastic:changeme@localhost:9200 load\r\ntest/functional/fixtures/es_archiver/many_fields`\r\n\r\n2. Navigate to Discover, switch to ES|QL mode and enter `FROM\r\nindices-stats | LIMIT 10`\r\n3. No chart is expected.\r\n\r\nAlso there should be no regression for\r\nhttps://github.com//pull/195863\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"b9439e658d5cca8dd89f7b3d7cc399c72e4e5103"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200583","number":200583,"mergeCommit":{"message":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)\n\n- Closes https://github.com/elastic/kibana/issues/199608\r\n\r\n## Summary\r\n\r\nThis PR changes the logic around when suggestions from lens API are\r\nused. Previously for non-transformational query and non-time-based data\r\nit would try to render one of lens suggestions supplying chart data via\r\n`table` prop. Now, it would not render any chart.\r\n\r\nBefore:\r\n- Data view mode => Static histogram configuration\r\n- ES|QL mode and non-transformational query => _**Gets lens\r\nsuggestions.**_ If histogram chart is not possible, **_takes the first\r\nlens suggestion for rendering the chart_**\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart.\r\n\r\nAfter:\r\n- Data view mode => Static histogram configuration (same)\r\n- ES|QL mode and non-transformational query => ~~_**Gets lens\r\nsuggestions.**_~~ If histogram chart is not possible, **_renders\r\nnothing_** (updated)\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart. (same)\r\n\r\n### Testing\r\n\r\nAs per originally reported case:\r\n1. `node scripts/es_archiver\r\n--kibana-url=http://elastic:changeme@localhost:5601\r\n--es-url=http://elastic:changeme@localhost:9200 load\r\ntest/functional/fixtures/es_archiver/many_fields`\r\n\r\n2. Navigate to Discover, switch to ES|QL mode and enter `FROM\r\nindices-stats | LIMIT 10`\r\n3. No chart is expected.\r\n\r\nAlso there should be no regression for\r\nhttps://github.com//pull/195863\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"b9439e658d5cca8dd89f7b3d7cc399c72e4e5103"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
…tional and non-time-based ES|QL queries (#200583) (#201184) # Backport This will backport the following commits from `main` to `8.17`: - [[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)](#200583) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-11-21T13:10:21Z","message":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)\n\n- Closes https://github.com/elastic/kibana/issues/199608\r\n\r\n## Summary\r\n\r\nThis PR changes the logic around when suggestions from lens API are\r\nused. Previously for non-transformational query and non-time-based data\r\nit would try to render one of lens suggestions supplying chart data via\r\n`table` prop. Now, it would not render any chart.\r\n\r\nBefore:\r\n- Data view mode => Static histogram configuration\r\n- ES|QL mode and non-transformational query => _**Gets lens\r\nsuggestions.**_ If histogram chart is not possible, **_takes the first\r\nlens suggestion for rendering the chart_**\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart.\r\n\r\nAfter:\r\n- Data view mode => Static histogram configuration (same)\r\n- ES|QL mode and non-transformational query => ~~_**Gets lens\r\nsuggestions.**_~~ If histogram chart is not possible, **_renders\r\nnothing_** (updated)\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart. (same)\r\n\r\n### Testing\r\n\r\nAs per originally reported case:\r\n1. `node scripts/es_archiver\r\n--kibana-url=http://elastic:changeme@localhost:5601\r\n--es-url=http://elastic:changeme@localhost:9200 load\r\ntest/functional/fixtures/es_archiver/many_fields`\r\n\r\n2. Navigate to Discover, switch to ES|QL mode and enter `FROM\r\nindices-stats | LIMIT 10`\r\n3. No chart is expected.\r\n\r\nAlso there should be no regression for\r\nhttps://github.com//pull/195863\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"b9439e658d5cca8dd89f7b3d7cc399c72e4e5103","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:DataDiscovery","Feature:ES|QL","backport:version","v8.17.0","v8.18.0"],"title":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries","number":200583,"url":"https://github.com/elastic/kibana/pull/200583","mergeCommit":{"message":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)\n\n- Closes https://github.com/elastic/kibana/issues/199608\r\n\r\n## Summary\r\n\r\nThis PR changes the logic around when suggestions from lens API are\r\nused. Previously for non-transformational query and non-time-based data\r\nit would try to render one of lens suggestions supplying chart data via\r\n`table` prop. Now, it would not render any chart.\r\n\r\nBefore:\r\n- Data view mode => Static histogram configuration\r\n- ES|QL mode and non-transformational query => _**Gets lens\r\nsuggestions.**_ If histogram chart is not possible, **_takes the first\r\nlens suggestion for rendering the chart_**\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart.\r\n\r\nAfter:\r\n- Data view mode => Static histogram configuration (same)\r\n- ES|QL mode and non-transformational query => ~~_**Gets lens\r\nsuggestions.**_~~ If histogram chart is not possible, **_renders\r\nnothing_** (updated)\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart. (same)\r\n\r\n### Testing\r\n\r\nAs per originally reported case:\r\n1. `node scripts/es_archiver\r\n--kibana-url=http://elastic:changeme@localhost:5601\r\n--es-url=http://elastic:changeme@localhost:9200 load\r\ntest/functional/fixtures/es_archiver/many_fields`\r\n\r\n2. Navigate to Discover, switch to ES|QL mode and enter `FROM\r\nindices-stats | LIMIT 10`\r\n3. No chart is expected.\r\n\r\nAlso there should be no regression for\r\nhttps://github.com//pull/195863\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"b9439e658d5cca8dd89f7b3d7cc399c72e4e5103"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200583","number":200583,"mergeCommit":{"message":"[Discover] Address chart performance issues for non-transformational and non-time-based ES|QL queries (#200583)\n\n- Closes https://github.com/elastic/kibana/issues/199608\r\n\r\n## Summary\r\n\r\nThis PR changes the logic around when suggestions from lens API are\r\nused. Previously for non-transformational query and non-time-based data\r\nit would try to render one of lens suggestions supplying chart data via\r\n`table` prop. Now, it would not render any chart.\r\n\r\nBefore:\r\n- Data view mode => Static histogram configuration\r\n- ES|QL mode and non-transformational query => _**Gets lens\r\nsuggestions.**_ If histogram chart is not possible, **_takes the first\r\nlens suggestion for rendering the chart_**\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart.\r\n\r\nAfter:\r\n- Data view mode => Static histogram configuration (same)\r\n- ES|QL mode and non-transformational query => ~~_**Gets lens\r\nsuggestions.**_~~ If histogram chart is not possible, **_renders\r\nnothing_** (updated)\r\n- ES|QL mode and transformational query => Gets lens suggestions. Takes\r\nthe first lens suggestion for rendering the chart. (same)\r\n\r\n### Testing\r\n\r\nAs per originally reported case:\r\n1. `node scripts/es_archiver\r\n--kibana-url=http://elastic:changeme@localhost:5601\r\n--es-url=http://elastic:changeme@localhost:9200 load\r\ntest/functional/fixtures/es_archiver/many_fields`\r\n\r\n2. Navigate to Discover, switch to ES|QL mode and enter `FROM\r\nindices-stats | LIMIT 10`\r\n3. No chart is expected.\r\n\r\nAlso there should be no regression for\r\nhttps://github.com//pull/195863\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"b9439e658d5cca8dd89f7b3d7cc399c72e4e5103"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
…and non-time-based ES|QL queries (elastic#200583) - Closes elastic#199608 ## Summary This PR changes the logic around when suggestions from lens API are used. Previously for non-transformational query and non-time-based data it would try to render one of lens suggestions supplying chart data via `table` prop. Now, it would not render any chart. Before: - Data view mode => Static histogram configuration - ES|QL mode and non-transformational query => _**Gets lens suggestions.**_ If histogram chart is not possible, **_takes the first lens suggestion for rendering the chart_** - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. After: - Data view mode => Static histogram configuration (same) - ES|QL mode and non-transformational query => ~~_**Gets lens suggestions.**_~~ If histogram chart is not possible, **_renders nothing_** (updated) - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. (same) ### Testing As per originally reported case: 1. `node scripts/es_archiver --kibana-url=http://elastic:changeme@localhost:5601 --es-url=http://elastic:changeme@localhost:9200 load test/functional/fixtures/es_archiver/many_fields` 2. Navigate to Discover, switch to ES|QL mode and enter `FROM indices-stats | LIMIT 10` 3. No chart is expected. Also there should be no regression for elastic#195863 ### Checklist - [x] [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 --------- Co-authored-by: Davis McPhee <davis.mcphee@elastic.co> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
…and non-time-based ES|QL queries (elastic#200583) - Closes elastic#199608 ## Summary This PR changes the logic around when suggestions from lens API are used. Previously for non-transformational query and non-time-based data it would try to render one of lens suggestions supplying chart data via `table` prop. Now, it would not render any chart. Before: - Data view mode => Static histogram configuration - ES|QL mode and non-transformational query => _**Gets lens suggestions.**_ If histogram chart is not possible, **_takes the first lens suggestion for rendering the chart_** - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. After: - Data view mode => Static histogram configuration (same) - ES|QL mode and non-transformational query => ~~_**Gets lens suggestions.**_~~ If histogram chart is not possible, **_renders nothing_** (updated) - ES|QL mode and transformational query => Gets lens suggestions. Takes the first lens suggestion for rendering the chart. (same) ### Testing As per originally reported case: 1. `node scripts/es_archiver --kibana-url=http://elastic:changeme@localhost:5601 --es-url=http://elastic:changeme@localhost:9200 load test/functional/fixtures/es_archiver/many_fields` 2. Navigate to Discover, switch to ES|QL mode and enter `FROM indices-stats | LIMIT 10` 3. No chart is expected. Also there should be no regression for elastic#195863 ### Checklist - [x] [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 --------- Co-authored-by: Davis McPhee <davis.mcphee@elastic.co> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Summary
This PR changes the logic around when suggestions from lens API are used. Previously for non-transformational query and non-time-based data it would try to render one of lens suggestions supplying chart data via
table
prop. Now, it would not render any chart.Before:
After:
Gets lens suggestions.If histogram chart is not possible, renders nothing (updated)Testing
As per originally reported case:
node scripts/es_archiver --kibana-url=http://elastic:changeme@localhost:5601 --es-url=http://elastic:changeme@localhost:9200 load test/functional/fixtures/es_archiver/many_fields
Navigate to Discover, switch to ES|QL mode and enter
FROM indices-stats | LIMIT 10
No chart is expected.
Also there should be no regression for #195863
Checklist