[ 
https://issues.apache.org/jira/browse/ARROW-9147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17256193#comment-17256193
 ] 

Gabriel Bassett commented on ARROW-9147:
----------------------------------------

I received the following error with arrow 2.0.0 (R):

```

Error in dataset___Scanner__ToTable(self): Type error: fields had matching 
names but differing types. From: <column_name>: bool To: <column_name>: null

```

Should this be fixed? Is it possible the order in which the null is encountered 
is handled differently?

> [C++][Dataset] Support null -> other type promotion in Dataset scanning
> -----------------------------------------------------------------------
>
>                 Key: ARROW-9147
>                 URL: https://issues.apache.org/jira/browse/ARROW-9147
>             Project: Apache Arrow
>          Issue Type: Sub-task
>          Components: C++
>            Reporter: Joris Van den Bossche
>            Assignee: Ben Kietzman
>            Priority: Major
>              Labels: dataset, dataset-dask-integration, pull-request-available
>             Fix For: 2.0.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> With regarding schema evolution / normalization, we support inserting nulls 
> for a missing column or changing nullability, or normalizing column order, 
> but we do not yet seem to support promotion of null type to any other type.
> Small python example:
> {code}
> In [11]: df = pd.DataFrame({"col": np.array([None, None, None, None], 
> dtype='object')})
>     ...: df.to_parquet("test_filter_schema.parquet", engine="pyarrow")
>     ...:
>     ...: import pyarrow.dataset as ds
>     ...: dataset = ds.dataset("test_filter_schema.parquet", format="parquet", 
> schema=pa.schema([("col", pa.int64())]))
>     ...: dataset.to_table()
> ...
> ~/scipy/repos/arrow/python/pyarrow/_dataset.pyx in 
> pyarrow._dataset.Dataset.to_table()
> ~/scipy/repos/arrow/python/pyarrow/_dataset.pyx in 
> pyarrow._dataset.Scanner.to_table()
> ~/scipy/repos/arrow/python/pyarrow/error.pxi in 
> pyarrow.lib.pyarrow_internal_check_status()
> ~/scipy/repos/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status()
> ArrowTypeError: fields had matching names but differing types. From: col: 
> null To: col: int64
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to