Add a typed SessionConfigExt setter for ballista.execution.mode

Open Beginner friendly
#2,729 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
api

Research direction

Start with the SessionConfigExt trait and the existing with_ballista_adaptive_query_planner helper to copy its pattern for the new setter and getter. The string key ballista.execution.mode and the execution_mode() parsing it feeds are the things to trace. Done means a typed setter and getter exist, ExecutionMode is re-exported from the client crate, and the snippet in docs/source/user-guide/pipelined-execution.md uses the helper.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem or challenge?

To use pipelined execution (#2652) from Rust today, you set the mode by its string key:

let config = SessionConfig::new_with_ballista()
    .set_str("ballista.execution.mode", "pipelined");

Most other Ballista session settings have a typed helper on SessionConfigExt, such as with_ballista_adaptive_query_planner(bool). The execution mode doesn't have one, so you have to know the key and its string values. This came up in review of the pipelined execution user guide (https://github.com/apache/datafusion-ballista/pull/2713#discussion_r4427001390).

Describe the solution you'd like

Add a typed setter and getter to SessionConfigExt, following the existing with_ballista_* convention:

fn with_ballista_execution_mode(self, mode: ExecutionMode) -> Self;
fn ballista_execution_mode(&self) -> ExecutionMode;

so enabling the mode becomes:

let config = SessionConfig::new_with_ballista()
    .with_ballista_execution_mode(ExecutionMode::Pipelined);

ExecutionMode would need to be reachable from the client crate's prelude or re-exports. The Rust snippet in docs/source/user-guide/pipelined-execution.md should then switch to the helper.

Describe alternatives you've considered

A dedicated constructor, SessionConfig::new_with_ballista_pipelined(). That would add a constructor per mode, and it wouldn't compose with configs built some other way. A setter matches how the other settings are exposed.

Additional context

The getter could also replace the scattered ballista_config().execution_mode() calls that parse the string.

Dominant language
Rust
Stars
2.2k
Forks
337
Avg merge
2d 1h
Merged PRs (30d)
113

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/datafusion-ballista

All issues in apache/datafusion-ballista

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.