(
&self,
sql: &str,
ctx: &SessionContext,
)
| 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 |
no test coverage detected