apache / apache/arrow-adbc

r/adbcdrivermanager: round-tripping zero-length factor returns wrong type

Open
#1,400 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
627
Forks
217
Avg merge
17h
Merged PRs (30d)
57

Description

Using SQLite, we currently have

```r
library(adbcdrivermanager)

db <- adbc_database_init(adbcsqlite::adbcsqlite(), uri = ":memory:")
con <- adbc_connection_init(db)

write_adbc(iris[0L, ], con, "iris0")
write_adbc(iris, con, "iris")

str(as.data.frame(read_adbc(con, "SELECT Species from iris")))
#> 'data.frame': 150 obs. of 5 variables:
#> $ Species: chr "setosa" "setosa" "setosa" "setosa" ...
str(as.data.frame(read_adbc(con, "SELECT Species from iris0")))
#> 'data.frame': 0 obs. of 5 variables:
#> $ Species: num
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the supplied R example with SQLite, comparing read_adbc() results for iris and iris0. Trace the round-trip handling of the zero-row Species column and verify that the empty result preserves the expected factor type, matching the non-empty table.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, sqlite
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.