Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make RuntimeEnvBuilder rather than RuntimeConfig #12157

Merged
merged 14 commits into from
Aug 28, 2024

Conversation

devanbenz
Copy link
Contributor

Signed-off-by: Devan devandbenz@gmail.com## Which issue does this PR close?

Closes #12156

Rationale for this change

Please see the issue #12156 for rationale.

What changes are included in this PR?

Renames RuntimeConfig struct to RuntimeEnvBuilder to state more clearly its usage. Includes a type alias for backwards compatibility to ensure non-breaking changes.

Are these changes tested?

Are there any user-facing changes?

Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
@github-actions github-actions bot added physical-expr Physical Expressions core Core DataFusion crate execution Related to the execution crate labels Aug 25, 2024
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
@devanbenz devanbenz requested a review from yjshen August 25, 2024 20:46
Signed-off-by: Devan <devandbenz@gmail.com>
Signed-off-by: Devan <devandbenz@gmail.com>
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- thank you @devanbenz and @yjshen

I think all we need to do is to merge up from main and this will be ready to merge

I think adding RuntimeEnvBuilder::build_arc() would make the code even nicer, but it can totally be done as a follow on PR (or never)

/// // Configure a 4k batch size
/// let config = SessionConfig::new() .with_batch_size(4 * 1024);
///
/// // configure a memory limit of 1GB with 20% slop
/// let runtime_env = RuntimeEnv::new(
/// RuntimeConfig::new()
/// let runtime_env = RuntimeEnvBuilder::new()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

let runtime_config = RuntimeConfig::new()
.with_memory_pool(Arc::new(GreedyMemoryPool::new(pool_size)));
let runtime = Arc::new(RuntimeEnv::new(runtime_config).unwrap());
let runtime = Arc::new(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a follow on maybe we could even make a build_arc() type method to make this even nicer looking

Following the model of https://docs.rs/datafusion/latest/datafusion/datasource/physical_plan/parquet/struct.ParquetExecBuilder.html#method.build_arc

datafusion/execution/src/runtime_env.rs Outdated Show resolved Hide resolved
Devan and others added 2 commits August 26, 2024 14:57
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@alamb alamb merged commit 5163e15 into apache:main Aug 28, 2024
24 checks passed
@alamb
Copy link
Contributor

alamb commented Aug 28, 2024

Thanks again @devanbenz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate execution Related to the execution crate physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make RuntimeEnvBuilder rather than RuntimeConfig
3 participants