You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Neal Richardson (Jira)" <ji...@apache.org> on 2021/10/25 12:44:00 UTC

[jira] [Commented] (ARROW-14457) [R] Support multiplying Arrays by R vectors and scalar value recycling

    [ https://issues.apache.org/jira/browse/ARROW-14457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17433729#comment-17433729 ] 

Neal Richardson commented on ARROW-14457:
-----------------------------------------

The latter could probably be fixed pretty easily

> [R] Support multiplying Arrays by R vectors and scalar value recycling
> ----------------------------------------------------------------------
>
>                 Key: ARROW-14457
>                 URL: https://issues.apache.org/jira/browse/ARROW-14457
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Nicola Crane
>            Priority: Major
>
> Scalar value recycling doesn't work on Arrays: 
> {code:r}
> > Array$create(c(1, 2)) * 3
> Array
> <double>
> [
>   3,
>   6
> ]
> > Array$create(c(1, 2)) * Array$create(c(3))
>  Error: Invalid: Array arguments must all be the same length
> /home/nic2/arrow/cpp/src/arrow/compute/exec.cc:569  ExecBatchIterator::Make(args, exec_context()->exec_chunksize())
> /home/nic2/arrow/cpp/src/arrow/compute/exec.cc:705  this->SetupArgIteration(args)
> /home/nic2/arrow/cpp/src/arrow/compute/exec.cc:630  PrepareExecute(args)
> /home/nic2/arrow/cpp/src/arrow/compute/function.cc:239  executor->Execute(implicitly_cast_args, &listener) 
> {code}
> Neither does multiplying by vectors (as they are converted to Scalar lists)
> {code:r}
> > Array$create(c(1,2)) * c(3,4)
>  Error: NotImplemented: Function multiply_checked has no kernel matching input types (array[double], scalar[list<item: double>])
> /home/nic2/arrow/cpp/src/arrow/compute/function.cc:215  DispatchBest(&inputs) 
> > Array$create(c(1, 2)) * Array$create(c(3, 4))
> Array
> <double>
> [
>   3,
>   8
> ]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)