(
&self,
partition: usize,
context: Arc<TaskContext>,
)
| 385 | } |
| 386 | |
| 387 | fn execute( |
| 388 | &self, |
| 389 | partition: usize, |
| 390 | context: Arc<TaskContext>, |
| 391 | ) -> Result<SendableRecordBatchStream> { |
| 392 | let shared_state = self |
| 393 | .execution_state |
| 394 | .get_or_init(|| self.data_source.create_sibling_state()) |
| 395 | .clone(); |
| 396 | let args = OpenArgs::new(partition, Arc::clone(&context)) |
| 397 | .with_shared_state(shared_state); |
| 398 | let stream = self.data_source.open_with_args(args)?; |
| 399 | let batch_size = context.session_config().batch_size(); |
| 400 | |
| 401 | log::debug!( |
| 402 | "Batch splitting enabled for partition {partition}: batch_size={batch_size}" |
| 403 | ); |
| 404 | let metrics = self.data_source.metrics(); |
| 405 | let split_metrics = SplitMetrics::new(&metrics, partition); |
| 406 | Ok(Box::pin(BatchSplitStream::new( |
| 407 | stream, |
| 408 | batch_size, |
| 409 | split_metrics, |
| 410 | ))) |
| 411 | } |
| 412 | |
| 413 | fn metrics(&self) -> Option<MetricsSet> { |
| 414 | let mut metrics = self.data_source.metrics().clone_inner(); |
nothing calls this directly
no test coverage detected