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

Method register_batch

datafusion/core/src/execution/context/mod.rs:536–543  ·  view source on GitHub ↗

Registers the given [`RecordBatch`] as the specified table reference.

(
        &self,
        table_ref: impl Into<TableReference>,
        batch: RecordBatch,
    )

Source from the content-addressed store, hash-verified

534
535 /// Registers the given [`RecordBatch`] as the specified table reference.
536 pub fn register_batch(
537 &self,
538 table_ref: impl Into<TableReference>,
539 batch: RecordBatch,
540 ) -> Result<Option<Arc<dyn TableProvider>>> {
541 let table = MemTable::try_new(batch.schema(), vec![vec![batch]])?;
542 self.register_table(table_ref, Arc::new(table))
543 }
544
545 /// Return the [RuntimeEnv] used to run queries with this `SessionContext`
546 pub fn runtime_env(&self) -> Arc<RuntimeEnv> {

Calls 3

newFunction · 0.85
schemaMethod · 0.45
register_tableMethod · 0.45