You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Nicola Crane (Jira)" <ji...@apache.org> on 2022/09/21 14:48:00 UTC
[jira] [Resolved] (ARROW-17699) [R] Add better error message for if a non-schema passed into open_dataset()
[ https://issues.apache.org/jira/browse/ARROW-17699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicola Crane resolved ARROW-17699.
----------------------------------
Fix Version/s: 10.0.0
Resolution: Fixed
Issue resolved by pull request 14108
[https://github.com/apache/arrow/pull/14108]
> [R] Add better error message for if a non-schema passed into open_dataset()
> ---------------------------------------------------------------------------
>
> Key: ARROW-17699
> URL: https://issues.apache.org/jira/browse/ARROW-17699
> Project: Apache Arrow
> Issue Type: Bug
> Components: R
> Reporter: Nicola Crane
> Assignee: Nicola Crane
> Priority: Major
> Labels: pull-request-available
> Fix For: 10.0.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The issue here comes from accidentally passing in the schema function instead of the created schema object, but the error message isn't helpful
> {code:r}
> 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
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)