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.
Adds helpers for ES|QL.
The ES|QL result format is meant to be compact: it is composed of a metadata part giving field names and their types and a 2D array of values, which isn't easy to use in application code.
This PR provides adapters that convert the ES|QL JSON result format into higher level types that are easier to use. Two adapters are provided:
ObjectsAdatper
that combines field names and values from the array to build a collection of objects using JSON to object mappingResultSetAdpater
that provides an implementation of the well-known JDBCResultSet
. This is a cursor-based API where the application can inspect at runtime the type and names of the ES|QL results, and is therefore more suited for ad-hoc or dynamic queries where the result structure isn't known in advance.Along with adapters, additional methods in
ElasticsearchEsqlClient
provide simple way to send queries using just a string and optional parameters when you don't need to specify additional request details.