Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace two memcpy() calls with Arrow{Array,Schema}Move #667

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/arrowio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ nanoarrowXPtr libtiledb_to_arrow(Rcpp::XPtr<tiledb::ArrayBuffers> ab,

spdl::info(tfm::format("[libtiledb_to_arrow] Incoming name %s length %d",
std::string(pp.second->name), pp.first->length));
memcpy((void*) sch->children[i], pp.second.get(), sizeof(ArrowSchema));
memcpy((void*) arr->children[i], pp.first.get(), sizeof(ArrowArray));
ArrowArrayMove(pp.first.get(), arr->children[i]);
ArrowSchemaMove(pp.second.get(), sch->children[i]);

if (is_factor) { // create an arrow array of type string with the labels
// this could be rewritten if we generalized ColumnBuffer to allow passing of strings
std::vector<std::string> svec = Rcpp::as<std::vector<std::string>>(dicts[i]);
Expand Down
Loading