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

Function create_context

datafusion-examples/examples/udf/advanced_udwf.rs:220–230  ·  view source on GitHub ↗

create local execution context with `cars.csv` registered as a table named `cars`

()

Source from the content-addressed store, hash-verified

218
219// create local execution context with `cars.csv` registered as a table named `cars`
220async 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

Callers 1

advanced_udwfFunction · 0.70

Calls 3

newFunction · 0.85
register_csvMethod · 0.45
path_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…