-
Notifications
You must be signed in to change notification settings - Fork 330
Add ESQL operator #1791
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -61,6 +61,7 @@ def register_default_runners(): | |||||||||||||||||||||||||||||||||||||||||||||||
| register_runner(track.OperationType.ClosePointInTime, ClosePointInTime(), async_runner=True) | ||||||||||||||||||||||||||||||||||||||||||||||||
| register_runner(track.OperationType.Sql, Sql(), async_runner=True) | ||||||||||||||||||||||||||||||||||||||||||||||||
| register_runner(track.OperationType.FieldCaps, FieldCaps(), async_runner=True) | ||||||||||||||||||||||||||||||||||||||||||||||||
| register_runner(track.OperationType.Esql, Esql(), async_runner=True) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # This is an administrative operation but there is no need for a retry here as we don't issue a request | ||||||||||||||||||||||||||||||||||||||||||||||||
| register_runner(track.OperationType.Sleep, Sleep(), async_runner=True) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2829,6 +2830,28 @@ def __repr__(self, *args, **kwargs): | |||||||||||||||||||||||||||||||||||||||||||||||
| return "field-caps" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| class Esql(Runner): | ||||||||||||||||||||||||||||||||||||||||||||||||
| async def __call__(self, es, params): | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
You can add support for these by using the rally/esrally/driver/runner.py Lines 210 to 231 in fc7d959
An example of usage: rally/esrally/driver/runner.py Line 1971 in fc7d959
|
||||||||||||||||||||||||||||||||||||||||||||||||
| params, request_params, transport_params, headers = self._transport_request_params(params) | ||||||||||||||||||||||||||||||||||||||||||||||||
| es = es.options(**transport_params) | ||||||||||||||||||||||||||||||||||||||||||||||||
| query = mandatory(params, "query", self) | ||||||||||||||||||||||||||||||||||||||||||||||||
| body = params.get("body", {}) | ||||||||||||||||||||||||||||||||||||||||||||||||
| body["query"] = query | ||||||||||||||||||||||||||||||||||||||||||||||||
| query_filter = params.get("filter") | ||||||||||||||||||||||||||||||||||||||||||||||||
| if query_filter: | ||||||||||||||||||||||||||||||||||||||||||||||||
| body["filter"] = query_filter | ||||||||||||||||||||||||||||||||||||||||||||||||
| if not bool(headers): | ||||||||||||||||||||||||||||||||||||||||||||||||
| # counter-intuitive, but preserves prior behavior | ||||||||||||||||||||||||||||||||||||||||||||||||
| headers = None | ||||||||||||||||||||||||||||||||||||||||||||||||
| # disable eager response parsing - responses might be huge thus skewing results | ||||||||||||||||||||||||||||||||||||||||||||||||
| es.return_raw_response() | ||||||||||||||||||||||||||||||||||||||||||||||||
| await es.perform_request(method="POST", path="/_query", headers=headers, body=body, params=request_params) | ||||||||||||||||||||||||||||||||||||||||||||||||
| return {"success": True, "unit": "ops", "weight": 1} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def __repr__(self, *args, **kwargs): | ||||||||||||||||||||||||||||||||||||||||||||||||
| return "esql" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| class RequestTiming(Runner, Delegator): | ||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, delegate): | ||||||||||||||||||||||||||||||||||||||||||||||||
| super().__init__(delegate=delegate) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
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.