pub struct Table {
pub(crate) record_batches: Vec<RecordBatch>,
pub(crate) schema: SchemaRef,
}Expand description
This is a convenience wrapper around Vec<RecordBatch> that tries to simplify conversion from
and to pyarrow.Table.
This could be used in circumstances where you either want to consume a pyarrow.Table directly
(although technically, since pyarrow.Table implements the ArrayStreamReader PyCapsule
interface, one could also consume a PyArrowType<ArrowArrayStreamReader> instead) or, more
importantly, where one wants to export a pyarrow.Table from a Vec<RecordBatch> from the Rust
side.
ⓘ
#[pyfunction]
fn return_table(...) -> PyResult<PyArrowType<Table>> {
let batches: Vec<RecordBatch>;
let schema: SchemaRef;
PyArrowType(Table::try_new(batches, schema).map_err(|err| err.into_py_err(py))?)
}Fields§
§record_batches: Vec<RecordBatch>§schema: SchemaRefImplementations§
Trait Implementations§
Source§impl FromPyArrow for Table
Convert a pyarrow.Table (or any other ArrowArrayStream compliant object) into Table
impl FromPyArrow for Table
Convert a pyarrow.Table (or any other ArrowArrayStream compliant object) into Table
Source§fn from_pyarrow_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self>
fn from_pyarrow_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self>
Convert a Python object to an arrow-rs type. Read more
Source§impl IntoPyArrow for Table
Convert a Table into pyarrow.Table.
impl IntoPyArrow for Table
Convert a Table into pyarrow.Table.
Source§fn into_pyarrow(self, py: Python<'_>) -> PyResult<Bound<'_, PyAny>>
fn into_pyarrow(self, py: Python<'_>) -> PyResult<Bound<'_, PyAny>>
Convert the implemented type into a Python object while consuming it.
Auto Trait Implementations§
impl Freeze for Table
impl !RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl !UnwindSafe for Table
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)