Execute the `DataFrame` and print only the first `num` rows of the result to the console. # Example ``` # use datafusion::prelude::*; # use datafusion::error::Result; # #[tokio::main] # async fn main() -> Result<()> { let ctx = SessionContext::new(); let df = ctx .read_csv("tests/data/example.csv", CsvReadOptions::new()) .await?; df.show_limit(10).await?; # Ok(()) # } ```
(self, num: usize)
| 1549 | /// # } |
| 1550 | /// ``` |
| 1551 | pub async fn show_limit(self, num: usize) -> Result<()> { |
| 1552 | let results = self.limit(0, Some(num))?.collect().await?; |
| 1553 | Ok(pretty::print_batches(&results)?) |
| 1554 | } |
| 1555 | |
| 1556 | /// Return a new [`TaskContext`] which would be used to execute this DataFrame |
| 1557 | pub fn task_ctx(&self) -> TaskContext { |