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

[R] Add better error message for if a non-schema passed into open_dataset() #32937

Closed
asfimport opened this issue Sep 13, 2022 · 1 comment
Closed
Assignees
Milestone

Comments

@asfimport
Copy link
Collaborator

The issue here comes from accidentally passing in the schema function instead of the created schema object, but the error message isn't helpful

library(dplyr)
desired_schema <- schema(mpg = float64(), disp = float64(), hp = int64(), drat = float64(), 
    wt = float64(), qsec = float64(), vs = int64(), am = int64(), 
    gear = int64(), carb = int64(), cyl = int64())

tf <- tempfile()
dir.create(tf)
write_dataset(group_by(mtcars, cyl), tf, format = "csv", hive_style = FALSE)
open_dataset(tf, format = "csv", schema = schema) %>% collect()
#> Error in `CsvFileFormat$create()`:
#> ! Values in `column_names` must match `schema` field names
#> ✖ `column_names` and `schema` field names match but are not in the same order

Reporter: Nicola Crane / @thisisnic
Assignee: Nicola Crane / @thisisnic

PRs and other links:

Note: This issue was originally created as ARROW-17699. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

Nicola Crane / @thisisnic:
Issue resolved by pull request 14108
#14108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants