This example demonstrates using DataFusion's DataFrame API # Reading from different formats [read_parquet]: execute queries against parquet files [read_csv]: execute queries against csv files [read_memory]: execute queries against in-memory arrow data [read_memory_macro]: execute queries against in-memory arrow data using macro # Writing out to local storage The following examples demonstrate
()
| 59 | /// * [where_in_subquery]: execute a subquery with an IN clause |
| 60 | /// * [where_exist_subquery]: execute a subquery with an EXISTS clause |
| 61 | pub async fn dataframe_example() -> Result<()> { |
| 62 | env_logger::init(); |
| 63 | // The SessionContext is the main high level API for interacting with DataFusion |
| 64 | let ctx = SessionContext::new(); |
| 65 | read_parquet(&ctx).await?; |
| 66 | read_csv(&ctx).await?; |
| 67 | read_memory(&ctx).await?; |
| 68 | read_memory_macro().await?; |
| 69 | write_out(&ctx).await?; |
| 70 | register_cars_test_data("t1", &ctx).await?; |
| 71 | register_cars_test_data("t2", &ctx).await?; |
| 72 | where_scalar_subquery(&ctx).await?; |
| 73 | where_in_subquery(&ctx).await?; |
| 74 | where_exist_subquery(&ctx).await?; |
| 75 | Ok(()) |
| 76 | } |
| 77 | |
| 78 | /// Use DataFrame API to |
| 79 | /// 1. Read parquet files, |
no test coverage detected
searching dependent graphs…