elastic / elasticsearch-specification

Elasticsearch full specification
Apache License 2.0
111 stars 68 forks source link

ESQL: define the `tables` parameter #2706

Closed nik9000 closed 2 weeks ago

nik9000 commented 3 weeks ago

Adds support for the tables parameter and documents the profile option.

nik9000 commented 3 weeks ago

I'm not sure what's up with the failure here. It looks like it doesn't like:

    tables?: Dictionary<
      string,
      Dictionary<string, SingleKeyDictionary<TableValuesType, any>>
    >

The SingleKeyDictionary<TableValuesType, any> doesn't feel quite right, but I'm not sure how tightly you need it here. That could be: {"long": [long|[long]]}/{"int": [int|[int]]}/{"keyword": [string|[string]]}/{"double": [double|[double]]}. But I don't know how to write that.

flobernd commented 3 weeks ago

I would model it like this:

// the naming should probably get improved
export type TableValuesData = long | int | string | double
export type TableValuesDataPayload = TableValuesData | TableValuesData[]
tables?: Dictionary<
   string,
   Dictionary<string, SingleKeyDictionary<TableValuesType, TableValuesDataPayload[]>>
>

Btw: any is invalid in the specification (note the failed validation). Instead, the UserDefinedValue might be used.

nik9000 commented 3 weeks ago

Btw: any is invalid in the specification (note the failed validation). Instead, the UserDefinedValue might be used.

Gotcha. I'll do it like you said without any. That's just better and not hard.

nik9000 commented 3 weeks ago

@flobernd have a look now!

github-actions[bot] commented 3 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

nik9000 commented 3 weeks ago

esql.query

Hey! I was testing that with make validate api=esql.query type=request branch=main locally. That does seem better. Though the response is defined as an ArrayBuffer so I think that should be skipped.

github-actions[bot] commented 3 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

github-actions[bot] commented 2 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

github-actions[bot] commented 2 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

github-actions[bot] commented 2 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

github-actions[bot] commented 2 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

nik9000 commented 2 weeks ago

Renamed. I've marked this auto-merge because I think that's what we want. I think I'm waiting on a final review.

github-actions[bot] commented 2 weeks ago

Following you can find the validation results for the APIs you have changed.

API Status Request Response
esql.async_query_get :orange_circle: Missing type Missing type
esql.async_query :orange_circle: Missing type Missing type
esql.query :red_circle: 233/233 12/233

You can validate these APIs yourself by using the make validate target.

nik9000 commented 2 weeks ago

Thanks for the feedback folks!