(
&self,
mut partition: usize,
context: Arc<TaskContext>,
)
| 277 | } |
| 278 | |
| 279 | fn execute( |
| 280 | &self, |
| 281 | mut partition: usize, |
| 282 | context: Arc<TaskContext>, |
| 283 | ) -> Result<SendableRecordBatchStream> { |
| 284 | trace!( |
| 285 | "Start UnionExec::execute for partition {} of context session_id {} and task_id {:?}", |
| 286 | partition, |
| 287 | context.session_id(), |
| 288 | context.task_id() |
| 289 | ); |
| 290 | let baseline_metrics = BaselineMetrics::new(&self.metrics, partition); |
| 291 | // record the tiny amount of work done in this function so |
| 292 | // elapsed_compute is reported as non zero |
| 293 | let elapsed_compute = baseline_metrics.elapsed_compute().clone(); |
| 294 | let _timer = elapsed_compute.timer(); // record on drop |
| 295 | |
| 296 | // find partition to execute |
| 297 | for input in self.inputs.iter() { |
| 298 | // Calculate whether partition belongs to the current partition |
| 299 | if partition < input.output_partitioning().partition_count() { |
| 300 | let stream = input.execute(partition, context)?; |
| 301 | debug!("Found a Union partition to execute"); |
| 302 | return Ok(Box::pin(ObservedStream::new( |
| 303 | stream, |
| 304 | baseline_metrics, |
| 305 | None, |
| 306 | ))); |
| 307 | } else { |
| 308 | partition -= input.output_partitioning().partition_count(); |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | warn!("Error in Union: Partition {partition} not found"); |
| 313 | |
| 314 | exec_err!("Partition {partition} not found in Union") |
| 315 | } |
| 316 | |
| 317 | fn metrics(&self) -> Option<MetricsSet> { |
| 318 | Some(self.metrics.clone_inner()) |
nothing calls this directly
no test coverage detected