[ https://issues.apache.org/jira/browse/ARROW-17543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17597051#comment-17597051 ]
Egill Axfjord Fridgeirsson commented on ARROW-17543: ---------------------------------------------------- That does look straightforward. I'd be happy to make a pull request for this. > [R] %in% on an empty vector c() fails > ------------------------------------- > > Key: ARROW-17543 > URL: https://issues.apache.org/jira/browse/ARROW-17543 > Project: Apache Arrow > Issue Type: Bug > Affects Versions: 9.0.0 > Reporter: Egill Axfjord Fridgeirsson > Priority: Major > > When using %in% on empty vectors I'm getting an error > "Error: Cannot infer type from vector" > I'd expect this to work the same as base R where you can use %in% on empty > vectors. > The arrow::is_in compute function does accept nulls as the value_set. If I > manually create an empty array of type NULL it does work as expected. > Reprex: > {code:java} > library(dplyr) > library(arrow) > options(arrow.debug=T) > #base R > a <- c(1,2,3) > b <- c() # NULL > a %in% b > #> [1] FALSE FALSE FALSE > # arrow arrays > arrowArray <- arrow::Array$create(c(1,2,3)) > arrow::is_in(arrowArray, c()) > #> Error: Cannot infer type from vector > # define type of c() manually > arrow::is_in(arrowArray, arrow::Array$create(c(), type=arrow::null())) > #> Array > #> <bool> > #> [ > #> false, > #> false, > #> false > #> ] > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)