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

Consolidate SessionConfig and ConfigOptions #3887

Open
Tracked by #4349
alamb opened this issue Oct 18, 2022 · 3 comments
Open
Tracked by #4349

Consolidate SessionConfig and ConfigOptions #3887

alamb opened this issue Oct 18, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Oct 18, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

While messing with thishttps://github.com//pull/3885 I found it quite confusing that SessionConfig is different than ConfigOptions and they had different ways of serializing / deserializing their values.

The new ConfigOptions was added by @andygrove #2754 and we can now see and set them via environment variables etc and are documented 🎉

https://github.com/apache/arrow-datafusion/blob/b654fdea697b9aec1cb487e292dd288e5c9d09e3/datafusion/core/src/config.rs#L235-L239

But it seems like SessionConfig is the old way and is still used (e.g. a field was just added by @Dandandan in #3846)

Describe the solution you'd like
It would be nice to unify the two (by moving all SessionConfig values into ConfigOptions)

https://github.com/apache/arrow-datafusion/blob/b654fdea697b9aec1cb487e292dd288e5c9d09e3/datafusion/core/src/execution/context.rs#L1128-L1156

Which is what I believe this comment in to_props is talking about:
https://github.com/apache/arrow-datafusion/blob/b654fdea697b9aec1cb487e292dd288e5c9d09e3/datafusion/core/src/execution/context.rs#L1282-L1289

Describe alternatives you've considered
Leave split brained as is

Additional context
#3821

@alamb alamb added the enhancement New feature or request label Oct 18, 2022
@waitingkuo
Copy link
Contributor

waitingkuo commented Oct 18, 2022

@alamb thank you! while i was changing ConfigOption I was thinking about this as well.

some of the setter (in SessionConfig) contains validator

e.g. n should be greater than 0 for batch_size

https://github.com/apache/arrow-datafusion/blob/feff5dc805449afa4a7ecb5ca88b979ad5739cce/datafusion/core/src/execution/context.rs#L1209-L1213

Do you think we should leave them in SessionConfig or move into ConfigOptions?

@alamb
Copy link
Contributor Author

alamb commented Oct 19, 2022

Do you think we should leave them in SessionConfig or move into ConfigOptions?

I think if there are specialized setters they can do the validation -- so if left the setter in SessionConfig we would leave the validation there too.

I guess in the long term it isn't so clear to me why we need two structures (SessionConfig and ConfigOptions) 🤔

@alamb
Copy link
Contributor Author

alamb commented Dec 5, 2022

@thinkharderdev inspired me to propose making the config options strongly typed -- would love to get other opinions on it #4517 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants