milenkovicm commented on code in PR #1478:
URL:
https://github.com/apache/datafusion-ballista/pull/1478#discussion_r2873500796
##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -247,33 +247,62 @@ impl<T: 'static + AsLogicalPlan> ExecutionPlan for
DistributedQueryExec<T> {
let session_config = context.session_config().clone();
- let stream = futures::stream::once(
- execute_query(
- self.scheduler_url.clone(),
- self.session_id.clone(),
- query,
- self.config.default_grpc_client_max_message_size(),
- GrpcClientConfig::from(&self.config),
- Arc::new(self.metrics.clone()),
- partition,
- session_config,
+ if session_config.ballista_config().client_pull() {
+ let stream = futures::stream::once(
+ execute_query_pull(
+ self.scheduler_url.clone(),
+ self.session_id.clone(),
+ query,
+ self.config.default_grpc_client_max_message_size(),
+ GrpcClientConfig::from(&self.config),
+ Arc::new(self.metrics.clone()),
+ partition,
+ session_config,
+ )
+ .map_err(|e| ArrowError::ExternalError(Box::new(e))),
)
- .map_err(|e| ArrowError::ExternalError(Box::new(e))),
- )
- .try_flatten()
- .inspect(move |batch| {
- metric_total_bytes.add(
- batch
- .as_ref()
- .map(|b| b.get_array_memory_size())
- .unwrap_or(0),
- );
-
- metric_row_count.add(batch.as_ref().map(|b|
b.num_rows()).unwrap_or(0));
- });
-
- let schema = self.schema();
- Ok(Box::pin(RecordBatchStreamAdapter::new(schema, stream)))
+ .try_flatten()
+ .inspect(move |batch| {
+ metric_total_bytes.add(
+ batch
+ .as_ref()
+ .map(|b| b.get_array_memory_size())
+ .unwrap_or(0),
+ );
+
+ metric_row_count.add(batch.as_ref().map(|b|
b.num_rows()).unwrap_or(0));
+ });
+
+ let schema = self.schema();
+ Ok(Box::pin(RecordBatchStreamAdapter::new(schema, stream)))
+ } else {
Review Comment:
if part will be removed once else part get stabilized. not too many
duplicated lines, would suggest to keep it as it is for, now if you agree
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]