Skip to content

Instantly share code, notes, and snippets.

@a-agmon
Last active July 8, 2024 20:06
Show Gist options
  • Save a-agmon/d66931cef847a975e589418caf2bb546 to your computer and use it in GitHub Desktop.
Save a-agmon/d66931cef847a975e589418caf2bb546 to your computer and use it in GitHub Desktop.
let lance_table = connection.open_table("table_name").execute().await?;
let batches = vec![Ok(RecordBatch::try_new(
schema.clone(),
vec![Arc::new(key_array), Arc::new(vectors_array)],
)?)
.map_err(|e| ArrowError::from_external_error(e.into()))];
let batch_iterator = RecordBatchIterator::new(batches, schema);
let boxed_batches = Box::new(batch_iterator);
lance_table.add(boxed_batches).execute().await?;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment