MCPcopy Create free account
hub / github.com/apache/paimon-rust / register_batch

Method register_batch

bindings/python/src/context.rs:141–149  ·  view source on GitHub ↗
(&self, name: String, batch: Bound<'_, PyAny>)

Source from the content-addressed store, hash-verified

139 }
140
141 fn register_batch(&self, name: String, batch: Bound<'_, PyAny>) -> PyResult<()> {
142 let batch = datafusion::arrow::record_batch::RecordBatch::from_pyarrow_bound(&batch)?;
143 let schema = batch.schema();
144 let mem_table = datafusion::datasource::MemTable::try_new(schema, vec![vec![batch]])
145 .map_err(df_to_py_err)?;
146 self.inner
147 .register_temp_table(&name, Arc::new(mem_table))
148 .map_err(df_to_py_err)
149 }
150
151 fn sql(&self, py: Python<'_>, sql: String) -> PyResult<Vec<Py<PyAny>>> {
152 let rt = runtime();

Calls 2

schemaMethod · 0.45
register_temp_tableMethod · 0.45