Elasticsearch: Add PPL response parser for logs and table format #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR is one of several PRs targeting the
elasticsearch-ppl-support-frontend
branch, which should ultimately contain all the changes required for basic PPL support from the Elasticsearch plugin on the client-side. Basic PPL support entails being able to write PPL queries in the query editor and visualize responses from Elasticsearch instances with the ODFE SQL plugin installed. Expected functionality such as variable interpolation and ad hoc filtering should also work with PPL queries. Features that are out of scope for theelasticsearch-ppl-support-frontend
branch include alerting on PPL queries and the option to use PPL queries in the dashboard settings menu.This PR adds the functionality to parse PPL response for log and table visualization in Grafana. The response format is chosen by the user through a dropdown in the PPL query editor UI which is implemented in PR # 3. The response structure for PPL is in JDBC format, meaning the response consists of a
schema
containing the response field name and type, and thedatarows
array containing the data results. These two components are merged together and flattened to work with the current Elasticsearch data frame structure.Please note that there is a bug in the response nested field when using PPL with Elasticsearch 7.9.1. It outputs extra types as fields causing the flatten method to include additional type names in their response. This bug has been fixed and will be available starting Elasticsearch 7.10.
Which issue(s) this PR fixes:
Partially resolves Grafana issue 28674
Special notes for your reviewer:
The relevant issue is not linked to avoid having this PR referenced in the issue conversation upstream.
cc: @alolita @robbierolin