Skip to content

Make RuntimeEnvBuilder rather than RuntimeConfig#12157

Merged
alamb merged 14 commits intoapache:mainfrom
devanbenz:feat/12156-runtime-env-builder
Aug 28, 2024
Merged

Make RuntimeEnvBuilder rather than RuntimeConfig#12157
alamb merged 14 commits intoapache:mainfrom
devanbenz:feat/12156-runtime-env-builder

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 Changes to the physical-expr crates 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 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

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
@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 Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make RuntimeEnvBuilder rather than RuntimeConfig

3 participants