thisisnic commented on issue #35180:
URL: https://github.com/apache/arrow/issues/35180#issuecomment-1522113246

   Thanks for all the effort there trying to make this work, I can see you've 
delved right into the deep end of things!
   
   > I tried to find a place for Array functions, but I realise that there are 
none
   
   So this isn't super well-documented, which is most likely why you didn't 
find it, but there's an R6 class in the package called ArrowDatum.  It's the 
base class for Array, ChunkedArray, and Scalar objects, and the point of it is 
basically to allow developers to write a function e.g. `my_fun.ArrowDatum()`, 
which will run on object of this class.
   
   For example, the S3 method for the `unique()` function (which has an 
identically named C++ equivalent function) looks like this:
   
   ```
   #' @export
   unique.ArrowDatum <- function(x, incomparables = FALSE, ...) {
     call_function("unique", x)
   }
   ```
   
   There's a PR here which shows someone implementing `exp` and `sqrt` both for 
Tables and for ArrowDatum objects.
   
   https://github.com/apache/arrow/pull/13517/files
   
   I reckon you could probably take a similar approach for the cumsum function. 
 It might end up being simpler than you thought (but it's the surrounding 
complexity, and things being hidden away which make it, reasonably, look 
complex).


-- 
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]

Reply via email to