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

Will Jones commented on ARROW-14999:
------------------------------------

So here are the conclusions I've gathered so far:

1. Equality of ListTypes and MapTypes have different behavior right now: list 
types with different field names are unequal, but map types with different 
field names are equal. We should make this behavior consistent and probably 
have an option in the {{.Equals()}} method to toggle checking these internal 
field names.
2. For extension arrays, it's important that we preserve these field names in 
most operations. That means that even if the default behavior is to ignore 
field names in equality for List/Map, unit tests for functions should check for 
field name equality.

I'm leaning right now that the default for checking equality should be to 
ignore field names for List/Map (obviously not for struct) in cases where we 
also don't check metadata. For example, {{TypeEquals()}} will check metadata 
and field names, while {{DataType::Equals()}} will not.

> [C++] List types with different field names are not equal
> ---------------------------------------------------------
>
>                 Key: ARROW-14999
>                 URL: https://issues.apache.org/jira/browse/ARROW-14999
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>    Affects Versions: 6.0.0
>            Reporter: Will Jones
>            Assignee: Will Jones
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 11.0.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When comparing map types, the names of the fields are ignored. This was 
> introduced in ARROW-7173.
> However for list types, they are not ignored. For example,
> {code:python}
> In [6]: l1 = pa.list_(pa.field("val", pa.int64()))
> In [7]: l2 = pa.list_(pa.int64())
> In [8]: l1
> Out[8]: ListType(list<val: int64>)
> In [9]: l2
> Out[9]: ListType(list<item: int64>)
> In [10]: l1 == l2
> Out[10]: False
> {code}
> Should we make list type comparison ignore field names too?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to