elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.12k forks source link

[ES|QL] AST pretty-printing #182257

Open drewdaemon opened 4 months ago

drewdaemon commented 4 months ago

There are use cases for making programmatic edits to an ES|QL query. For example, adding or changing a where clause when a user filters by a field (ref).

We have code to parse an ES|QL string to an AST (a reader), but no code for the inverse (a generator).

This leaves us no choice but to use string manipulation.

Instead, we should provide a generator so that edits can be made to the AST and then serialized into a new query. This is a more robust and less error-prone method of manipulating queries.

elasticmachine commented 4 months ago

Pinging @elastic/kibana-esql (Team:ESQL)

vadimkibana commented 1 month ago

Depends on https://github.com/elastic/kibana/issues/189259

vadimkibana commented 1 month ago

Depends on https://github.com/elastic/kibana/discussions/182393#discussioncomment-10158693

vadimkibana commented 1 month ago

Optionally depends on https://github.com/elastic/kibana/discussions/182393#discussioncomment-10157968 and https://github.com/elastic/kibana/discussions/182393#discussioncomment-10157792

vadimkibana commented 1 month ago

Blocked by https://github.com/elastic/kibana/issues/189491

vadimkibana commented 1 month ago

Blocked by https://github.com/elastic/kibana/issues/189913