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

Method execute_sql_without_result_buffering

benchmarks/src/sql_benchmark.rs:575–596  ·  view source on GitHub ↗
(
        &self,
        sql: &str,
        ctx: &SessionContext,
    )

Source from the content-addressed store, hash-verified

573 }
574
575 async fn execute_sql_without_result_buffering(
576 &self,
577 sql: &str,
578 ctx: &SessionContext,
579 ) -> Result<usize> {
580 let mut row_count = 0;
581
582 let df = ctx.sql(sql).await?;
583 let physical_plan = df.create_physical_plan().await?;
584
585 self.validate_expected_plan(&physical_plan)?;
586 let mut stream = execute_stream(physical_plan, ctx.task_ctx())?;
587
588 while let Some(batch) = stream.next().await {
589 row_count += batch?.num_rows();
590
591 // Evaluate the result and do nothing, the result will be dropped
592 // to reduce memory pressure
593 }
594
595 Ok(row_count)
596 }
597
598 pub fn name(&self) -> &str {
599 &self.name

Callers 1

runMethod · 0.45

Calls 6

execute_streamFunction · 0.85
sqlMethod · 0.80
create_physical_planMethod · 0.45
task_ctxMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected