-
Notifications
You must be signed in to change notification settings - Fork 313
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
Add ESQL operator #1791
Add ESQL operator #1791
Conversation
/cc @craigtaverner |
This reverts commit a053ecc.
@@ -2829,6 +2830,23 @@ def __repr__(self, *args, **kwargs): | |||
return "field-caps" | |||
|
|||
|
|||
class Esql(Runner): | |||
async def __call__(self, es, params): |
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.
There are a couple of high level properties that operations should expose, namely:
request-timeout
headers
opaque-id
You can add support for these by using the Runner._transport_request_params
helper method:
rally/esrally/driver/runner.py
Lines 210 to 231 in fc7d959
def _transport_request_params(params): | |
""" | |
Takes all of a runner's params and splits out request parameters, transport | |
level parameters, and headers into their own respective dicts. | |
:param params: A hash with all the respective runner's parameters. | |
:return: A tuple of the specific runner's params, request level parameters, transport level parameters, and headers, respectively. | |
""" | |
transport_params = {} | |
request_params = params.get("request-params", {}) | |
if request_timeout := params.pop("request-timeout", None): | |
transport_params["request_timeout"] = request_timeout | |
if (ignore_status := request_params.pop("ignore", None)) or (ignore_status := params.pop("ignore", None)): | |
transport_params["ignore_status"] = ignore_status | |
headers = params.pop("headers", None) or {} | |
if opaque_id := params.pop("opaque-id", None): | |
headers.update({"x-opaque-id": opaque_id}) | |
return params, request_params, transport_params, headers |
An example of usage:
rally/esrally/driver/runner.py
Line 1971 in fc7d959
params, request_params, transport_params, headers = self._transport_request_params(params) |
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.
LGTM. I left one comment about using a helper method around configuring the different request, transport, and header parameters but no need for another review.
@b-deam @gbanasiak Thanks for reviews. |
@elasticmachine run rally/it-python310 please |
|
||
* ``query`` (mandatory): An ES|QL query starts with a source command followed processing commands. | ||
* ``filter`` (optional): A query filter defined in `Elasticsearch query DSL <https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html>`_. | ||
* ``body`` (optional): The query body. |
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.
The description here should indicate that this is used for anything additions to put into the body, since the query will already be placed there. For example, we use this for pragma
.
This pull request introduces the ES|QL operator. This operator, for now, supports only two main parameters:
query
andfilter
.