Skip to content
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] [Discover] Displays the histogram suggestion always for non transformational commands #195863

Merged
merged 5 commits into from
Oct 14, 2024

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Oct 11, 2024

Summary

Closes #195752

This PR is fixing 2 bugs:

  • It filters out counter fields from the breakdown as they are not supported. I created a new util for this
  • Fixes a bug unrelated with the breakdown (it also exists in previous minors). The LensVis service is computing suggestions and pushes them to availableSuggestionsWithType . In some indexes (it depends on the types of the first 5 columns of the index) the lens suggestions api might return a suggestion. So in that case the array has the histogram suggestion + the suggestion from the suggestions api. So the service will pick the first one which is not the histogram. But we know that in case of non transformational commands we want to suggest the histogram. So this PR is fixing it by ensuring that the array is cleaned up before pushing the histogram suggestion.

Note: The 2 bugs are unrelated I just decided to fix them in one PR as they are both histogram bugs.

Checklist

@stratoula stratoula changed the title [ES|QL] [Discover] Fixes the histogram suggestion [ES|QL] [Discover] Displays the histogram suggestion always for non transformational commands Oct 11, 2024
@stratoula stratoula added Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana labels Oct 11, 2024
@stratoula stratoula marked this pull request as ready for review October 11, 2024 12:26
@stratoula stratoula requested review from a team as code owners October 11, 2024 12:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind temporary unskipping test/functional/apps/discover/group3/_lens_vis.ts tests in this PR to see whether CI passes? Sorry for the inconvenience!

@stratoula
Copy link
Contributor Author

I unskipped the test, it passed so I skipped it again 👍

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! 👍

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
unifiedHistogram 69.7KB 70.1KB +350.0B
Unknown metric groups

API count

id before after diff
@kbn/esql-utils 77 79 +2

History

Copy link
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stratoula stratoula merged commit f962cdc into elastic:main Oct 14, 2024
21 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11325129997

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2024
…ransformational commands (elastic#195863)

## Summary

Closes elastic#195752

This PR is fixing 2 bugs:

- It filters out counter fields from the breakdown as they are not
supported. I created a new util for this
- Fixes a bug unrelated with the breakdown (it also exists in previous
minors). The LensVis service is computing suggestions and pushes them to
`availableSuggestionsWithType `. In some indexes (it depends on the
types of the first 5 columns of the index) the lens suggestions api
might return a suggestion. So in that case the array has the histogram
suggestion + the suggestion from the suggestions api. So the service
will pick the first one which is not the histogram. But we know that in
case of non transformational commands we want to suggest the histogram.
So this PR is fixing it by ensuring that the array is cleaned up before
pushing the histogram suggestion.

Note: The 2 bugs are unrelated I just decided to fix them in one PR as
they are both histogram bugs.

### 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

(cherry picked from commit f962cdc)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 14, 2024
… non transformational commands (#195863) (#196074)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] [Discover] Displays the histogram suggestion always for non
transformational commands
(#195863)](#195863)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2024-10-14T09:52:16Z","message":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational commands (#195863)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195752\r\n\r\nThis PR is fixing
2 bugs:\r\n\r\n- It filters out counter fields from the breakdown as
they are not\r\nsupported. I created a new util for this\r\n- Fixes a
bug unrelated with the breakdown (it also exists in previous\r\nminors).
The LensVis service is computing suggestions and pushes them
to\r\n`availableSuggestionsWithType `. In some indexes (it depends on
the\r\ntypes of the first 5 columns of the index) the lens suggestions
api\r\nmight return a suggestion. So in that case the array has the
histogram\r\nsuggestion + the suggestion from the suggestions api. So
the service\r\nwill pick the first one which is not the histogram. But
we know that in\r\ncase of non transformational commands we want to
suggest the histogram.\r\nSo this PR is fixing it by ensuring that the
array is cleaned up before\r\npushing the histogram
suggestion.\r\n\r\n\r\nNote: The 2 bugs are unrelated I just decided to
fix them in one PR as\r\nthey are both histogram bugs.\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","sha":"f962cdcd796af9908449155c989dd03438165773","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor","Feature:ES|QL"],"title":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational
commands","number":195863,"url":"https://github.com/elastic/kibana/pull/195863","mergeCommit":{"message":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational commands (#195863)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195752\r\n\r\nThis PR is fixing
2 bugs:\r\n\r\n- It filters out counter fields from the breakdown as
they are not\r\nsupported. I created a new util for this\r\n- Fixes a
bug unrelated with the breakdown (it also exists in previous\r\nminors).
The LensVis service is computing suggestions and pushes them
to\r\n`availableSuggestionsWithType `. In some indexes (it depends on
the\r\ntypes of the first 5 columns of the index) the lens suggestions
api\r\nmight return a suggestion. So in that case the array has the
histogram\r\nsuggestion + the suggestion from the suggestions api. So
the service\r\nwill pick the first one which is not the histogram. But
we know that in\r\ncase of non transformational commands we want to
suggest the histogram.\r\nSo this PR is fixing it by ensuring that the
array is cleaned up before\r\npushing the histogram
suggestion.\r\n\r\n\r\nNote: The 2 bugs are unrelated I just decided to
fix them in one PR as\r\nthey are both histogram bugs.\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","sha":"f962cdcd796af9908449155c989dd03438165773"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195863","number":195863,"mergeCommit":{"message":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational commands (#195863)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195752\r\n\r\nThis PR is fixing
2 bugs:\r\n\r\n- It filters out counter fields from the breakdown as
they are not\r\nsupported. I created a new util for this\r\n- Fixes a
bug unrelated with the breakdown (it also exists in previous\r\nminors).
The LensVis service is computing suggestions and pushes them
to\r\n`availableSuggestionsWithType `. In some indexes (it depends on
the\r\ntypes of the first 5 columns of the index) the lens suggestions
api\r\nmight return a suggestion. So in that case the array has the
histogram\r\nsuggestion + the suggestion from the suggestions api. So
the service\r\nwill pick the first one which is not the histogram. But
we know that in\r\ncase of non transformational commands we want to
suggest the histogram.\r\nSo this PR is fixing it by ensuring that the
array is cleaned up before\r\npushing the histogram
suggestion.\r\n\r\n\r\nNote: The 2 bugs are unrelated I just decided to
fix them in one PR as\r\nthey are both histogram bugs.\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","sha":"f962cdcd796af9908449155c989dd03438165773"}}]}]
BACKPORT-->

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
jughosta added a commit that referenced this pull request Nov 21, 2024
…and non-time-based ES|QL queries (#200583)

- Closes #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
#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>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 21, 2024
…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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 21, 2024
…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)
kibanamachine added a commit that referenced this pull request Nov 21, 2024
…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>
kibanamachine added a commit that referenced this pull request Nov 21, 2024
…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>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…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>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Discover Discover Application Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ESQL][Discover] Selecting a breakdown field for a TSDB index always gives a breakdown by agent.keyword
5 participants