feat: introduce ArrowNative wrapper struct for adding data that is already a RecordBatchReader (#1139)

In
2de226220b
I added a new `IntoArrow` trait for adding data into a table.
Unfortunately, it seems my approach for implementing the trait for
"things that are already record batch readers" was flawed. This PR
corrects that flaw and, conveniently, removes the need to box readers at
all (though it is ok if you do).
This commit is contained in:
Weston Pace
2024-03-20 13:28:17 -07:00
committed by GitHub
parent dbdd0a7b4b
commit 7d790bd9e7
7 changed files with 26 additions and 49 deletions

View File

@@ -89,7 +89,7 @@ impl Table {
pub async fn add(&self, buf: Buffer, mode: String) -> napi::Result<()> {
let batches = ipc_file_to_batches(buf.to_vec())
.map_err(|e| napi::Error::from_reason(format!("Failed to read IPC file: {}", e)))?;
let mut op = self.inner_ref()?.add(Box::new(batches));
let mut op = self.inner_ref()?.add(batches);
op = if mode == "append" {
op.mode(AddDataMode::Append)