Skip to content

add a better display API #678

Description

@jayshrivastava

In #623, we add a new rewrite API prior to displaying:

let plan =
    rewrite_distributed_plan_with_dynamic_filters(plan).await?;

// 4. Fold the per-task metrics back into the plan...
let plan =
    rewrite_distributed_plan_with_metrics(plan, DistributedMetricsFormat::Aggregated).await?;

// 5. ...and render it.
println!("{}", display_plan_ascii(plan.as_ref(), true));

It's annoying to have to call those two rewrites.

Ideally, if you set with_distributed_dynamic_filter_collection or with_distributed_metrics_collection, then displaying is handled automatically. One downside to this is that those settings are stored in the SessionConfig, so you would have to pass a SessionConfig to display_plan_ascii, which isn't great.

Another way to do it is to add options to explain_analyze or display_plan_ascii

DisplayOptions {
    metrics_mode: Aggregated | PerTask
    dynamic_filters: bool
}

and have those methods handle the rewrites for you.

I imagine we want to improve the API for both metrics and

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions