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 contains all the changes required for basic PPL support from the Elasticsearch plugin on the client-side, minus the UI changes. 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 will also work with PPL queries.
Query Builder:
The default PPL query is set to request for all data fields in the index specified by the user when configuring the Elasticsearch datasource. The PPL query builder also includes a time range filter by default to ensure the response is in the range specified by the user through the Grafana’s time range drop down menu.
Ad hoc filters for PPL are handled using the where command which gets added onto the user inputted query string in the main PPL query builder method.
Logs and Table Response Parser:
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.Time Series Response Parser:
In order for users to create time series queries with PPL, there are a few requirements for how the inputted query should be formatted. One of the returned column must have a valid date time type supported by PPL, which are
timestamp
,datetime
,date
. Response must also include another column with numeric datatype as values. No additional columns should be returned other than the two. If any of these requirements are not met, users will be outputted with an error.