create local execution context with `cars.csv` registered as a table named `cars`
()
| 218 | |
| 219 | // create local execution context with `cars.csv` registered as a table named `cars` |
| 220 | async fn create_context() -> Result<SessionContext> { |
| 221 | // declare a new context. In spark API, this corresponds to a new spark SQL session |
| 222 | let ctx = SessionContext::new(); |
| 223 | |
| 224 | let dataset = ExampleDataset::Cars; |
| 225 | |
| 226 | ctx.register_csv("cars", dataset.path_str()?, CsvReadOptions::new()) |
| 227 | .await?; |
| 228 | |
| 229 | Ok(ctx) |
| 230 | } |
| 231 | |
| 232 | /// In this example we register `SmoothItUdf` as user defined window function |
| 233 | /// and invoke it via the DataFrame API and SQL |
no test coverage detected
searching dependent graphs…