-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Refactor SessionContext, BallistaContext to support multi-tenancy configurations - Part 3 #2091
Conversation
Hi, @alamb @yjshen @andygrove @xudong963 @thinkharderdev @yahoNanJing Please help to take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't review all the Ballista changes carefully, but I did review the changes to DataFusion and they look good to me.
Epic work @mingmwang
@@ -982,6 +1008,14 @@ pub struct SessionState { | |||
pub runtime_env: Arc<RuntimeEnv>, | |||
} | |||
|
|||
/// Default session builder using the provided configuration | |||
pub fn default_session_builder(config: SessionConfig) -> SessionState { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is already a SessionContext::with_config_rt
maybe we could name this function SessionState::with_config
and the existing SessionState::with_config
to SessionState::with_config_rt
for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
runtime, | ||
} | ||
} | ||
} | ||
|
||
impl FunctionRegistry for TaskContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -836,7 +836,7 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue { | |||
|
|||
pub fn parse_expr( | |||
proto: &protobuf::LogicalExprNode, | |||
ctx: &SessionContext, | |||
registry: &dyn FunctionRegistry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
// /// Batch size when reading CSV or Parquet files | ||
// #[structopt(short = "s", long = "batch-size", default_value = "8192")] | ||
// batch_size: usize, | ||
/// Batch size when reading CSV or Parquet files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!
Thanks @mingmwang. I do agree to remove the SessionContext from the Ballista executor and to serialize session related things in the task definition.😄🐂 |
I'll plan to merge this PR on Monday unless we hear anything else -- this PR is likely to accumulate conflicts quickly. In fact it looks like it has accumulated a few conflicts already which need to be resolved |
I will resolve the conflicts today. |
abee72c
to
43ab96e
Compare
…figurations - Part 3 resolve review comments
43ab96e
to
539edbe
Compare
Rebased to master to resolve conflicts. |
Thanks again @mingmwang and everyone else who helped review this PR! |
Which issue does this PR close?
Closes #1862.
Rationale for this change
What changes are included in this PR?
This is the part3 of the PR. It covers the below parts:
&mut` self
in SessionContext methods, trivial UT fixesoptional_session_id
toExecuteQueryParams
, add session_id and props toTaskDefinition
. Create new SessionContext for the first time of the query and reuse the existing SessionContext for ongoing queries for a users.Are there any user-facing changes?