sandugood opened a new pull request, #1650:
URL: https://github.com/apache/datafusion-ballista/pull/1650
# Which issue does this PR close?
Closes #1627.
# Rationale for this change
Add additional optional query parameters to the Scheduler's REST API to get
data about the jobs.
# What changes are included in this PR?
1. Added JobQueryParams struct for optional query parameters construction
with two fields: include_logical and tree_rendered
2. Based on optional parameters a JSON response is formed:
- `include_logical` is true by default, but can be configured to be excluded
from the response. Extracted by the name it is responsible for returning
`logical_plan` to the user
- `tree_rendered` is the query parameter that controls how `physical_plan`
is rendered. If `tree_rendered` is set to `false` then it is rendered as
`DisplayableExecutionPlan::new(job.physical_plan().as_ref()).indent(false)`,
otherwise
`displayable(job.physical_plan().as_ref()).tree_render().to_string()`, which
can be easily rendered on the user side
```
curl -s 'localhost:50050/api/job/JcYQYNY?tree_rendered=true' | jq -r
".physical_plan"
┌───────────────────────────┐
│ AggregateExec │
│ -------------------- │
│ aggr: │
│ min(test.c12), max(test │
│ .c12) │
│ │
│ group_by: c1 │
│ │
│ mode: │
│ FinalPartitioned │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│ RepartitionExec │
│ -------------------- │
│ partition_count(in->out): │
│ 1 -> 4 │
│ │
│ partitioning_scheme: │
│ Hash([c1@0], 4) │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│ AggregateExec │
│ -------------------- │
│ aggr: │
│ min(test.c12), max(test │
│ .c12) │
│ │
│ group_by: c1 │
│ mode: Partial │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│ FilterExec │
│ -------------------- │
│ predicate: │
│ c11 > 0.1 AND c11 < 0.9 │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│ DataSourceExec │
│ -------------------- │
│ files: 1 │
│ format: csv │
└───────────────────────────┘
```
# Are there any user-facing changes?
Additional query parameters added to the Scheduler's REST API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]