bkietz commented on a change in pull request #10196:
URL: https://github.com/apache/arrow/pull/10196#discussion_r625957033



##########
File path: r/R/expression.R
##########
@@ -56,13 +56,9 @@ build_array_expression <- function(FUN,
                                    args = list(...),
                                    options = empty_named_list()) {
   if (FUN == "-" && length(args) == 1L) {
-    # Unary -, i.e. just make it negative, and somehow this works
     if (inherits(args[[1]], c("ArrowObject", "array_expression"))) {
-      # Make it be 0 - arg
-      # TODO(ARROW-11950): do this in C++ compute
-      args <- list(0L, args[[1]])
+      return(build_array_expression("negate", args[[1]]))

Review comment:
       Alright, note that `negate_checked` does not support unsigned arguments:
   ```r
   call_function("negate_checked", args=list(Array$create(c(1,2), 
type=uint8())))
   #> Error: NotImplemented: Function negate_checked has no kernel matching 
input types (array[uint8])
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to