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

Guess big integers? #500

Open
rjake opened this issue Jun 19, 2023 · 0 comments
Open

Guess big integers? #500

rjake opened this issue Jun 19, 2023 · 0 comments
Labels
colspec 📁 feature a feature request or enhancement

Comments

@rjake
Copy link

rjake commented Jun 19, 2023

Our data warehouse started using integer64 values for our keys and without specifying, these come through as col_double(). We want to reduce errors when saving and reading in the data and I wanted to know if vroom could guess at the col_big_integer() column type for us? I'm afraid folks on the team won't remember to specify it and they will get duplicate values in their analyses. For example, dplyr::n_distinct(visit_key) would show 1 unique value.

x <- 
  I(
    "visit_key, name
    100000000000000100, A
    100000000000000101, B"
    #              ---
  )

vroom::vroom(x) |>
  dplyr::pull(visit_key)
#> 100000000000000096
#> 100000000000000096
#>                ---


vroom::vroom(
  x, 
  col_types = vroom::cols("visit_key" = vroom::col_big_integer())
) |> 
  dplyr::pull(visit_key)
#> 100000000000000100 
#> 100000000000000101
#>                ---
@hadley hadley added feature a feature request or enhancement colspec 📁 labels Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
colspec 📁 feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants