sql icon indicating copy to clipboard operation
sql copied to clipboard

[FEATURE] Support optional tags field on _async_query API

Open noCharger opened this issue 11 months ago • 0 comments

Is your feature request related to a problem?

A clear and concise description of what the problem is, e.g. I'm always frustrated when [...]

I want to track out the different sources that are executing '_async_query'.

What solution would you like?

A clear and concise description of what you want to happen.

Assign tags alone with the _async_query API, which has a one-to-one mapping to the queryid. These tags can be used on a variety of data source types, such as s3_glue, and provided to emr job runs.

API example:

curl --location 'http://localhost:9200/_plugins/_async_query' \
--header 'Content-Type: application/json' \
--data '{
    "datasource" : "my_glue",
    "lang" : "sql",
    "query" : "select * from my_glue.default.http_logs limit 10"
    "tags": {
        "traceId": "xxxxx",
        "source": "admin"
     }
}'

Parameter Constraints

Type: String to string map
Map Entries: Minimum number of 0 items. Maximum number of 10 items.
Key Length Constraints: Minimum length of 1. Maximum length of 128.
Key Pattern: ^[A-Za-z0-9 /_.:=+@-]+$
Value Length Constraints: Minimum length of 0. Maximum length of 256.
Value Pattern: ^[A-Za-z0-9 /_.:=+@-]*$
Required: No

Ref: https://docs.aws.amazon.com/emr-serverless/latest/APIReference/API_StartJobRun.html#emrserverless-StartJobRun-request-tags

What alternatives have you considered?

A clear and concise description of any alternative solutions or features you've considered.

Define tags during data source creation, which requires creating multiple identical data source with different tags.

noCharger avatar Mar 12 '24 20:03 noCharger