You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Nicola Crane (Jira)" <ji...@apache.org> on 2021/09/22 11:33:00 UTC

[jira] [Created] (ARROW-14067) [R] Add error handling to list_compute_functions() for C++ compute functions which don't have bindings in R

Nicola Crane created ARROW-14067:
------------------------------------

             Summary: [R] Add error handling to list_compute_functions() for C++ compute functions which don't have bindings in R
                 Key: ARROW-14067
                 URL: https://issues.apache.org/jira/browse/ARROW-14067
             Project: Apache Arrow
          Issue Type: Improvement
          Components: R
            Reporter: Nicola Crane


Currently we have the function {{list_compute_functions()}} which lists all available Arrow compute functions.  However, it can return functions which have been implemented in C++ but don't yet have bindings in R.

A recent ticket implemented (nearly) all of the remaining compute functions without bound options at that moment, but more could appear.

Currently the error message shown is:

{code:java}
library(dplyr)
library(arrow) # 5.0.0.2
Table$create(tibble::tibble(Species = c("versicolor", "virginica", "setosa"))) %>%
    mutate(x = arrow_utf8_trim(Species, options = list(characters = "a")))
## Error: Invalid: Attempted to initialize KernelState from null FunctionOptions
{code}

We should catch this and instead raise a more user-friendly error. 

Also, if a valid function is called without options supplied, we get a {{could not find function}} error:

{code:java}
library(dplyr)
library(arrow) # dev
Table$create(tibble::tibble(Species = c("versicolor", "virginica", "setosa"))) %>%
  mutate(x = arrow_utf8_trim(Species))
## Error in arrow_utf8_trim(Species) :  could not find function "arrow_utf8_trim"
{code}

It'd be great to instead inform the user that the correct options haven't been supplied.



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