Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend enumeration support to non-string levels #609

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

eddelbuettel
Copy link
Member

@eddelbuettel eddelbuettel commented Nov 2, 2023

This PR adds support for reads of enumeration types possible in arrow but not in the stricter R factor setup. For other types we collapse the levels information into the actual data (i.e. converting from factor to vector). One such example where the last two columns were written from arrow as dictionaries with, respectively, float64 and bool levels:

$ Rscript -e 'tiledb::tiledb_array("/some/uri/some/where", return_as="tibble")[]'
# A tibble: 5 × 5
  soma_joinid   int string `enum-float64` `enum-bool`
      <int64> <int> <chr>           <dbl> <lgl>      
1           0   100 red               1.2 TRUE       
2           1   101 yellow            3.4 TRUE       
3           2   102 green             5.6 FALSE      
4           3   103 red               1.2 TRUE       
5           4   104 green             5.6 FALSE      
$ 

SC 36358

While rare to impossible in plain R, this is possible from Arrow as in the SOMA project
Copy link

This pull request has been linked to Shortcut Story #36358: Extend enumeration support.

@johnkerl
Copy link
Contributor

johnkerl commented Nov 2, 2023

Context: single-cell-data/TileDB-SOMA#1846

@eddelbuettel eddelbuettel merged commit b1f7c7a into master Nov 2, 2023
1 check passed
@eddelbuettel eddelbuettel deleted the de/sc-36358/extend_enumeration branch November 2, 2023 15:59
@eddelbuettel eddelbuettel mentioned this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants