apache / apache/datafusion-ballista

Prune unneccessary data from task definition

Open
#619 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
2.1k
Forks
320
Avg merge
1d 22h
Merged PRs (30d)
66

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and *why* for this feature, in addition to the *what*)

When the scheduler sends a task to the executor it has to send the serialized `ExecutionPlan`. For very large plans (for isntance, scanning 10s of thousands of files) the plan can be very large and the cost to serialize/deserialize to protobuf is significant.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

Since each task is only executing a single partition, we can prune all the `FileScanConfig` `file_groups` for other partitions. This can eliminate most of the bulk of the serialized plan.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

1. When preparing a task definition, prune the `ExecutionPlan` prior to serialization. This can be done pretty straightforwardly as a `PhysicalOptimizerRule` to handle the standard cases (`ParquetExec`, `CsvExec`, etc).
2. For custom cases such as user-defined `ExecutionPlan` impls, add an argument to `PhysicalExtensionCodec::try_encode`:

```
pub trait PhysicalExtensionCodec: Debug + Send + Sync {
fn try_encode(
&self,
node: Arc,
partitions: &[usize],
buf: &mut Vec,
) -> Result<(), BallistaError>;

...

}
```

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how task definitions serialize and deserialize the ExecutionPlan, then inspect the PhysicalOptimizerRule path and the FileScanConfig file_groups used by ParquetExec and CsvExec. Review PhysicalExtensionCodec::try_encode for custom ExecutionPlan implementations; done means task plans omit file groups for other partitions while supported custom cases remain encodable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
distributed-systems, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.