nuno-faria commented on code in PR #19316:
URL: https://github.com/apache/datafusion/pull/19316#discussion_r3004964871


##########
datafusion/physical-plan/src/analyze.rs:
##########
@@ -54,6 +55,25 @@ pub struct AnalyzeExec {
     /// The output schema for RecordBatches of this exec node
     schema: SchemaRef,
     cache: Arc<PlanProperties>,
+    /// If Some, passes the output of the analyze once it completes, as well 
as the duration.
+    callback: Option<AnalyzeCallback>,
+    /// If true, returns the inner batches instead of the analyze result.
+    /// Can be used together with the `callback` to keep track of the analyze 
result without
+    /// having to return it as the plan's output.
+    return_inner: bool,
+}
+
+/// Optionally used by the `AnalyzeExec` operator to callback it with the 
result.

Review Comment:
   I replaced the callback with the following trait:
   
   ```rust
   pub trait AnalyzeObserver: Debug + Send + Sync {
       /// Provides the EXPLAIN ANALYZE output (annotated plan) and the total 
duration.
       fn analyze_result_callback(
           &self,
           result: RecordBatch,
           duration: std::time::Duration,
       ) -> Result<()>;
   }
   ```



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

Reply via email to