You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "milenkovicm (via GitHub)" <gi...@apache.org> on 2026/04/03 12:34:49 UTC

Re: [PR] fix: remove unwrap from executor and improve task error handling [datafusion-ballista]

milenkovicm commented on code in PR #1540:
URL: https://github.com/apache/datafusion-ballista/pull/1540#discussion_r3032694915


##########
ballista/executor/src/executor_server.rs:
##########
@@ -369,83 +369,109 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> ExecutorServer<T,
             partition_id,
         };
 
-        let query_stage_exec = self
-            .executor
-            .execution_engine
-            .create_query_stage_exec(
-                job_id.clone(),
-                stage_id,
-                plan,
-                &self.executor.work_dir,
-            )
-            .unwrap();
-
-        let task_context = {
-            let function_registry = task.function_registry;
-            let runtime = self.executor.produce_runtime(&task.session_config).unwrap();
-
-            Arc::new(TaskContext::new(
-                Some(task_identity.clone()),
-                task.session_id,
-                task.session_config,
-                function_registry.scalar_functions.clone(),
-                function_registry.aggregate_functions.clone(),
-                function_registry.window_functions.clone(),
-                runtime,
-            ))
-        };
+        match self.executor.execution_engine.create_query_stage_exec(
+            job_id.clone(),
+            stage_id,
+            plan,
+            &self.executor.work_dir,
+        ) {
+            Ok(exec) => {
+                let task_context = {
+                    let function_registry = task.function_registry;
+                    let runtime =
+                        self.executor.produce_runtime(&task.session_config).unwrap();

Review Comment:
   we can remove this unwrap as well 



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org