apache / apache/arrow

[R] Error when trying to create a dictionary from character column

Open
#39,273 1 comment 0 reactions 1 assignee Claimed by @paleolimbot View on GitHub
Component: R Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

``` r
library(arrow)
#>
#> Attaching package: 'arrow'
#> The following object is masked from 'package:utils':
#>
#> timestamp
df <- tibble::tibble(x = c("hi", "I'm", "a", "string"))
arrow_table(df)
#> Table
#> 4 rows x 1 columns
#> $x
arrow_table(df, schema = schema(x = dictionary()))
#> Error: Invalid: invalid R type to convert to dictionary
```

It works if I call `as.factor` on the character column when it's being created; perhaps we can just pop an `as.factor()` in if the input type is a character rather than a factor?

### Component(s)

R

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.