diff --git a/src/arrowio.cpp b/src/arrowio.cpp index fc2bf3f9d0..208ceaea2b 100644 --- a/src/arrowio.cpp +++ b/src/arrowio.cpp @@ -409,8 +409,9 @@ nanoarrowXPtr libtiledb_to_arrow(Rcpp::XPtr 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 svec = Rcpp::as>(dicts[i]);