You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/10/18 07:30:00 UTC
[jira] [Updated] (ARROW-17784) [C++] Opening a dataset where partitioning variable is already in the dataset should error differently
[ https://issues.apache.org/jira/browse/ARROW-17784?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated ARROW-17784:
-----------------------------------
Labels: pull-request-available (was: )
> [C++] Opening a dataset where partitioning variable is already in the dataset should error differently
> ------------------------------------------------------------------------------------------------------
>
> Key: ARROW-17784
> URL: https://issues.apache.org/jira/browse/ARROW-17784
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Reporter: Nicola Crane
> Assignee: Sanjiban Sengupta
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The error message given when the name of the partition given matches a field in the dataset is a bit misleading - can we catch this earlier and give a different error message?
> {code:r}
> # R code
> library(dplyr)
> library(arrow)
> tf <- tempfile()
> dir.create(tf)
> write_dataset(mtcars, tf, partitioning = "cyl", hive_style = FALSE)
> # The schema fed into `partitioning` should refer to `cyl` and not `wt`, but the error message doesn't refer to the duplication here
> open_dataset(tf, partitioning = schema(wt = int64())) %>% collect()
> #> Error in `open_dataset()`:
> #> ! Invalid: Unable to merge: Field wt has incompatible types: double vs int64
> #> /home/nic2/arrow/cpp/src/arrow/type.cc:1692 fields_[i]->MergeWith(field)
> #> /home/nic2/arrow/cpp/src/arrow/type.cc:1755 AddField(field)
> #> /home/nic2/arrow/cpp/src/arrow/type.cc:1826 builder.AddSchema(schema)
> #> /home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:262 Inspect(options.inspect_options)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)