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

DataFrame owned SessionState #4633

Merged
merged 4 commits into from
Dec 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion datafusion/core/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ impl SessionContext {
LogicalPlan::SetVariable(SetVariable {
variable, value, ..
}) => {
let config_options = &self.state.write().config.config_options;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm actually somewhat surprised this was compiling, there must be some magic going on to extend the lifetime of the temporary lock guard, which is wild

let state = self.state.write();
let config_options = &state.config.config_options;

let old_value =
config_options.read().get(&variable).ok_or_else(|| {
Expand Down Expand Up @@ -410,6 +411,8 @@ impl SessionContext {
))
}
}
drop(state);

self.return_empty_dataframe()
}

Expand Down