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

[PR] prototype [datafusion-ballista]

danielhumanmod opened a new pull request, #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#issuecomment-4173864599

   > thanks @danielhumanmod just bear with me, i'm a but stuck with time, will have a look asap
   
   No rush, please take your take! I can keep working on the 2nd part about the explain analyze impl


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod closed pull request #1536: feat: Refactor DistributedQueryExec to support job callback mechanisim
URL: https://github.com/apache/datafusion-ballista/pull/1536


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#issuecomment-4174564856

   Just a quick thought: Instead of adding handlers, what if we created new Execs and combined them on the client side? For example, for EXPLAIN ANALYZE, we could build an ExplainAnalyzeExec -> DistributedQueryExec pipeline. 
   
   DistributedQueryExec would run the inner query, and once completed, ExplainAnalyzeExec would call the scheduler API to get the runtime metrics. 
   
   Seems like this might fit the DataFusion better?


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "milenkovicm (via GitHub)" <gi...@apache.org>.
milenkovicm commented on PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#issuecomment-4188590262

   > Just a quick thought: Instead of adding handlers, what if we created new Execs and combined them on the client side? For example, for EXPLAIN ANALYZE, we could build an ExplainAnalyzeExec -> DistributedQueryExec pipeline. 
   > 
   > 
   > 
   > DistributedQueryExec would run the inner query, and once completed, ExplainAnalyzeExec would call the scheduler API to get the runtime metrics. 
   > 
   > 
   > 
   > Seems like this might fit the DataFusion better?
   
   I agree, should not be too complex 


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on code in PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#discussion_r3020022710


##########
ballista/core/src/execution_plans/job_callback_handler/fetch_results.rs:
##########


Review Comment:
   This file is mostly migrated from the old code in `distributed_query.rs`. In my initial plan we will add more handlers in this crate (eg. explain analyze impl)



-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on code in PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#discussion_r3020027771


##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -588,204 +579,16 @@ async fn execute_query_push(
                 partition_location,
                 ..
             })) => {
-                // Calculate job execution time (server-side execution)
-                let job_execution_ms = ended_at.saturating_sub(started_at);
-                let duration = Duration::from_millis(job_execution_ms);
-
-                info!("Job {job_id} finished executing in {duration:?} ");
-
-                // Calculate scheduling time (server-side queue time)
-                // This includes network latency and actual queue time
-                let scheduling_ms = started_at.saturating_sub(queued_at);
-
-                // Calculate total query time (end-to-end from client perspective)
-                let total_elapsed = query_start_time.elapsed();
-                let total_ms = total_elapsed.as_millis();
-
-                // Set timing metrics
-                let metric_job_execution = MetricBuilder::new(&metrics)
-                    .gauge("job_execution_time_ms", partition);
-                metric_job_execution.set(job_execution_ms as usize);
-
-                let metric_scheduling =
-                    MetricBuilder::new(&metrics).gauge("job_scheduling_in_ms", partition);
-                metric_scheduling.set(scheduling_ms as usize);
-
-                let metric_total_time =
-                    MetricBuilder::new(&metrics).gauge("total_query_time_ms", partition);
-                metric_total_time.set(total_ms as usize);
-
-                // Note: data_transfer_time_ms is not set here because partition fetching
-                // happens lazily when the stream is consumed, not during execute_query.
-                // This could be added in a future enhancement by wrapping the stream.
-
-                let streams = partition_location.into_iter().map(move |partition| {
-                    let f = fetch_partition(
-                        partition,
-                        max_message_size,
-                        true,
-                        scheduler_url.clone(),
-                        flight_proxy.clone(),
-                        customize_endpoint.clone(),
-                        use_tls,
-                    )
-                    .map_err(|e| ArrowError::ExternalError(Box::new(e)));
-
-                    futures::stream::once(f).try_flatten()
+                break Ok(CompletedJob {
+                    job_id,
+                    partition_location,
+                    flight_proxy,
+                    queued_at,
+                    started_at,
+                    ended_at,
+                    query_start_time,
                 });
-
-                break Ok(futures::stream::iter(streams).flatten());
             }
         };
     }
 }
-
-fn get_client_host_port(

Review Comment:
   migrate to the fetch result handler too



-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on code in PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#discussion_r3020022710


##########
ballista/core/src/execution_plans/job_callback_handler/fetch_results.rs:
##########


Review Comment:
   This file is mostly migrated from the old code in `distributed_query.rs`



-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "milenkovicm (via GitHub)" <gi...@apache.org>.
milenkovicm commented on PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#issuecomment-4172063958

   thanks @danielhumanmod 
   just bear with me, i'm a but stuck with time, will have a look asap


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#issuecomment-4211466606

   > > Just a quick thought: Instead of adding handlers, what if we created new Execs and combined them on the client side? For example, for EXPLAIN ANALYZE, we could build an ExplainAnalyzeExec -> DistributedQueryExec pipeline.
   > > DistributedQueryExec would run the inner query, and once completed, ExplainAnalyzeExec would call the scheduler API to get the runtime metrics.
   > > Seems like this might fit the DataFusion better?
   > 
   > I agree, should not be too complex
   
   Thanks for your thought here, will work on that :)


-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on code in PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#discussion_r3020025933


##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -434,74 +466,33 @@ async fn execute_query_pull(
                 partition_location,
                 ..
             })) => {
-                // Calculate job execution time (server-side execution)

Review Comment:
   This part is same for pull/push, so extract the common code to the handler



##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -588,204 +579,16 @@ async fn execute_query_push(
                 partition_location,
                 ..
             })) => {
-                // Calculate job execution time (server-side execution)

Review Comment:
   This part is same for pull/push, so extract the common code to the handler



-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on code in PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#discussion_r3020022710


##########
ballista/core/src/execution_plans/job_callback_handler/fetch_results.rs:
##########


Review Comment:
   This file is mostly migrated from the old code in `distributed_query.rs`. In my initial plan we will add more handlers in this crate



-- 
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


Re: [PR] feat: Refactor DistributedQueryExec to support job callback mechanisim [datafusion-ballista]

Posted by "danielhumanmod (via GitHub)" <gi...@apache.org>.
danielhumanmod commented on PR #1536:
URL: https://github.com/apache/datafusion-ballista/pull/1536#issuecomment-4167839318

   Hey @milenkovicm , I create this PR to introduce job callback mechanism in client side, as the replacement for #1428 , appreciate your thought here when you have time, thanks!


-- 
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