MCPcopy Create free account
hub / github.com/apache/datafusion / execute

Method execute

datafusion/datasource/src/source.rs:387–411  ·  view source on GitHub ↗
(
        &self,
        partition: usize,
        context: Arc<TaskContext>,
    )

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 8

newFunction · 0.85
with_shared_stateMethod · 0.80
session_configMethod · 0.80
cloneMethod · 0.45
create_sibling_stateMethod · 0.45
open_with_argsMethod · 0.45
batch_sizeMethod · 0.45
metricsMethod · 0.45

Tested by

no test coverage detected