Skip to content

[FEATURE] Improve PPL Explain Results #4351

Closed

Description

@penghuo

Is your feature request related to a problem?
Current explain results include \\\\ which is hard to remove when debuging DSL query.

{\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"query\":{\"query_string\":{\"query\":\"(@timestamp:>=now\\\\-3M\\\\/y) AND (@timestamp:<=now)\",\"fields\":[],\"type\":\"best_fields\",\"default_operator\":\"or\",\"max_determinized_states\":10000,\"enable_position_increments\":true,\"fuzziness\":\"AUTO\",\"fuzzy_prefix_length\":0,\"fuzzy_max_expansions\":50,\"phrase_slop\":0,\"escape\":false,\"auto_generate_synonyms_phrase_query\":true,\"fuzzy_transpositions\":true,\"boost\":1.0}},\"_source\":{\"includes\":[\"@timestamp\",\"category\",\"value\",\"timestamp\"],\"excludes\":[]},\"sort\":[{\"_doc\":{\"order\":\"asc\"}}]}

What solution would you like?
DSL query could be copy from explain result, and past as query body.

What alternatives have you considered?
n/a

Do you have any additional context?
Add any other context or screenshots about the feature request here.

Activity

  1. added
    enhancement
    PPL
    on Sep 22, 2025
  2. Swiddis commented on Sep 23, 2025

    @Swiddis
    Collaborator

    This is mostly just because we output the whole plan as one JSON string, I wrote a CLI patch to pretty-print the internals of it. You can also get pretty far with curl ... | jq -r .calcite.physical

    IMO we should tidy up the json format to output all the operators in a proper machine-readable JSON tree, and have a separate ?format=raw which outputs these inner strings directly as content-type: text/plain.

  3. moved this from Not Started to Done in PPL Trackeron Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions