You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/25 17:39:39 UTC

[GitHub] [arrow-datafusion] alamb commented on a change in pull request #2091: Refactor SessionContext, BallistaContext to support multi-tenancy configurations - Part 3

alamb commented on a change in pull request #2091:
URL: https://github.com/apache/arrow-datafusion/pull/2091#discussion_r835478120



##########
File path: datafusion/src/execution/context.rs
##########
@@ -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 {

Review comment:
       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

##########
File path: datafusion/src/execution/context.rs
##########
@@ -1331,16 +1382,48 @@ impl From<&SessionState> for TaskContext {
     fn from(state: &SessionState) -> Self {
         let session_id = state.session_id.clone();
         let config = state.config.clone();
+        let scalar_functions = state.scalar_functions.clone();
+        let aggregate_functions = state.aggregate_functions.clone();
         let runtime = state.runtime_env.clone();
         Self {
             task_id: None,
             session_id,
             properties: TaskProperties::SessionConfig(config),
+            scalar_functions,
+            aggregate_functions,
             runtime,
         }
     }
 }
 
+impl FunctionRegistry for TaskContext {

Review comment:
       👍 

##########
File path: benchmarks/src/bin/tpch.rs
##########
@@ -83,9 +85,10 @@ struct BallistaBenchmarkOpt {
     #[structopt(short = "i", long = "iterations", default_value = "3")]
     iterations: usize,
 
-    // /// 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

Review comment:
       👍 

##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -836,7 +836,7 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
 
 pub fn parse_expr(
     proto: &protobuf::LogicalExprNode,
-    ctx: &SessionContext,
+    registry: &dyn FunctionRegistry,

Review comment:
       👍 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org