aboyoun opened a new issue, #43163:
URL: https://github.com/apache/arrow/issues/43163

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   When support was added for `cumsum` in the `Math` group generics in the R 
client, it mistakenly mapped `signif`, `expm1`, `log1p`, `cospi`, `sinpi`, 
`tanpi`, `cosh`, `sinh`, `tanh`, `acosh`, `asinh`, `atanh`, `lgamma`, `gamma`, 
`digamma`, and `trigamma` to the `cumulative_sum_checked` arrow function.
   
   Here is an example:
   
   ```
   R> suppressMessages(library(arrow))
   R> cumsum(Array$create(c(0.6, 2.1, 0)))
   Array
   <double>
   [
     0.6,
     2.7,
     2.7
   ]
   R> log1p(Array$create(c(0.6, 2.1, 0)))
   Array
   <double>
   [
     0.6,
     2.7,
     2.7
   ]
   R> packageVersion("arrow")
   [1] ‘16.1.0’
   ```
    
    The mismapping can be seen in the `switch` statement below:
    
    ```
    > arrow:::Math.ArrowDatum
   function (x, ..., base = exp(1), digits = 0) 
   {
       switch(.Generic, abs = eval_array_expression("abs_checked", 
           x), ceiling = eval_array_expression("ceil", x), sign = , 
           floor = , trunc = , acos = , asin = , atan = , cos = , 
           sin = , tan = {
               eval_array_expression(.Generic, x)
           }, log = eval_array_expression("logb_checked", x, base), 
           log10 = eval_array_expression("log10_checked", x), round = 
eval_array_expression("round", 
               x, options = list(ndigits = digits, round_mode = 
RoundMode$HALF_TO_EVEN)), 
           sqrt = eval_array_expression("sqrt_checked", x), exp = 
eval_array_expression("power_checked", 
               exp(1), x), signif = , expm1 = , log1p = , cospi = , 
           sinpi = , tanpi = , cosh = , sinh = , tanh = , acosh = , 
           asinh = , atanh = , lgamma = , gamma = , digamma = , 
           trigamma = , cumsum = 
eval_array_expression("cumulative_sum_checked", 
               x), cumprod = , cummax = , cummin = , stop(paste0("Unsupported 
operation on `", 
               class(x)[1L], "` : "), .Generic, call. = FALSE))
   }
   ```
   
   ### Component(s)
   
   R


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