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

Better api for setting ConfigOptions from SessionContext #3908

Closed
alamb opened this issue Oct 20, 2022 · 3 comments
Closed

Better api for setting ConfigOptions from SessionContext #3908

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

Comments

@alamb
Copy link
Contributor

alamb commented Oct 20, 2022

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

I want to set configuration options given a session context. Right now I need to do it like 🤮

        let session_ctx = SessionContext::new();

        {
            // lock scope
            let state = session_ctx.state.write();
            let mut config_options = state.config.config_options.write();
            config_options.set_bool(OPT_PARQUET_PUSHDOWN_FILTERS, true);
            config_options.set_bool(OPT_PARQUET_REORDER_FILTERS, true);
        }

Describe the solution you'd like

I would like an API like this:

        let session_ctx = SessionContext::new()
          .with_bool(OPT_PARQUET_PUSHDOWN_FILTERS, true)
          .with_bool(OPT_PARQUET_REORDER_FILTERS, true);

As well as

        let session_ctx = SessionContext::new();
        session_ctx.set_bool(OPT_PARQUET_PUSHDOWN_FILTERS, true);
        session_ctx.set_bool(OPT_PARQUET_REORDER_FILTERS, true);

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@comphead
Copy link
Contributor

@alamb I'm wondering if you ok with current working alternative

let ctx = SessionContext::with_config(SessionConfig::new().set_bool("key", true).set_bool("key2", false));

@alamb
Copy link
Contributor Author

alamb commented Oct 20, 2022

@comphead it is probably OK.

I don't plan to work on the ConfigOptions any more once I consolidate the parquet options. I guess I'll see if others have some ideas on how to make the API nicer

@alamb
Copy link
Contributor Author

alamb commented Dec 5, 2022

Let's discuss this in the larger context of #4349

@alamb alamb closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2022
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