paleolimbot commented on code in PR #288:
URL: https://github.com/apache/arrow-nanoarrow/pull/288#discussion_r1311602812
##########
r/R/convert-array.R:
##########
@@ -85,14 +85,28 @@ convert_array <- function(array, to = NULL, ...) {
#' @export
convert_array.default <- function(array, to = NULL, ..., .from_c = FALSE) {
if (.from_c) {
+ # Handle extension conversion
+ # We don't need the user-friendly versions and this is
performance-sensitive
+ schema <- .Call(nanoarrow_c_infer_schema_array, array)
+ parsed <- .Call(nanoarrow_c_schema_parse, schema)
Review Comment:
This is a good observation that exposes a larger design flaw in the current
system: at the point that `convert_array()` is called, we pretty much need the
parsed version of a schema (i.e., `ArrowSchemaView`) and the parsed version of
the array (i.e., `ArrowArrayView`). I wrote the Python bindings to handle this
from the ground up but here there are a number of hacks like this one (and more
than a few in C). I'm going to try to fix all of those in a more systemic way
(but don't quite have the time to do it yet).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]