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

Function execute_to_batches

datafusion/core/tests/sql/mod.rs:131–138  ·  view source on GitHub ↗

Execute query and return results as a Vec of RecordBatches

(ctx: &SessionContext, sql: &str)

Source from the content-addressed store, hash-verified

129
130/// Execute query and return results as a Vec of RecordBatches
131async fn execute_to_batches(ctx: &SessionContext, sql: &str) -> Vec<RecordBatch> {
132 let df = ctx.sql(sql).await.unwrap();
133
134 // optimize just for check schema don't change during optimization.
135 df.clone().into_optimized_plan().unwrap();
136
137 df.collect().await.unwrap()
138}
139
140/// Execute query and return result set as 2-d table of Vecs
141/// `result[row][column]`

Calls 4

sqlMethod · 0.80
into_optimized_planMethod · 0.80
collectMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…