Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions r/R/expression.R
Original file line numberDiff line numberDiff line change
Expand Up@@ -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_checked", args[[1]]))
} else {
# Somehow this works
return(-args[[1]])
}
}
Expand DownExpand Up@@ -288,12 +284,9 @@ build_dataset_expression <- function(FUN,
args = list(...),
options = empty_named_list()) {
if (FUN == "-" && length(args) == 1L) {
# Unary -, i.e. make it negative
if (inherits(args[[1]], c("ArrowObject", "Expression"))) {
# TODO(ARROW-11950): do this in C++ compute
args <- list(0L, args[[1]])
return(build_dataset_expression("negate_checked", args[[1]]))
} else {
# Somehow this just works
return(-args[[1]])
}
}
Expand Down