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

Config Cleanup: Remove TaskProperties and KV structure, keep key=value serialization #4382

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 26, 2022

Which issue does this PR close?

re #4349

Rationale for this change

Step 1 of N in unraveling the gordian knot of datafusion configuration

While there is a need to serialize/deserialize session state as key=value pairs in SessionContext, there is no reason these key / value pairs need to be kept in the actual TaskContext after it is created and having the different representation makes the eventual unification of configuration that much harder.

What changes are included in this PR?

  1. Remove duplication in From impls
  2. Remove TaskProperties and just use SessionConfig everywhere

Are these changes tested?

covered by existing tests

Are there any user-facing changes?

If you use TaskProperties directly you'll be impacted, but I don't think anyone does. It is not used by ballista https://github.com/search?q=repo%3Aapache%2Farrow-ballista%20KVPairs&type=code

@mingmwang this code was originally added by you in #1987 -- can you take a look ?

@alamb alamb added the api change Changes the API exposed to users of the crate label Nov 26, 2022
@github-actions github-actions bot added the core Core DataFusion crate label Nov 26, 2022
Copy link
Contributor Author

@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.

cc @liukun4515 and @yahoNanJing as I believe you follow ballista closely

/// Task Context Properties
pub enum TaskProperties {
///SessionConfig
SessionConfig(SessionConfig),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The core of the change is to just use SessionConfig everywhere, creating it in the constructor of TaskContext if needed

aggregate_functions,
runtime,
}
TaskContext::from(&*session.state.read())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a drive by clean up as the code was replicated in impl From<&SessionState> for TaskContext {

scalar_functions,
aggregate_functions,
runtime,
}
}

/// Return the SessionConfig associated with the Task
pub fn session_config(&self) -> SessionConfig {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this conversion from string/value properties to SessionConfig is moved to TaskContext::new

@mingmwang
Copy link
Contributor

I will take a closer look at the configuration related issues today.

@mingmwang
Copy link
Contributor

@alamb

I'm OK with the change.

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

Looks like a good start to cleaning up the configs

@alamb
Copy link
Contributor Author

alamb commented Nov 28, 2022

I plan to merge this tomorrow unless I hear otherwise and then will likely work on chipping away at the random parquet settings that are sprinkled around to make them visible via ConfigOptions

@alamb alamb merged commit 1438bc4 into apache:master Nov 29, 2022
@alamb alamb deleted the alamb/remove_kv branch November 29, 2022 15:31
@ursabot
Copy link

ursabot commented Nov 29, 2022

Benchmark runs are scheduled for baseline = 02da32e and contender = 1438bc4. 1438bc4 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants