You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (JIRA)" <ji...@apache.org> on 2019/06/03 12:15:00 UTC

[jira] [Updated] (ARROW-5278) [C#] ArrowBuffer should either implement IEquatable correctly or not at all

     [ https://issues.apache.org/jira/browse/ARROW-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Pitrou updated ARROW-5278:
----------------------------------
    Component/s: C#

> [C#] ArrowBuffer should either implement IEquatable correctly or not at all
> ---------------------------------------------------------------------------
>
>                 Key: ARROW-5278
>                 URL: https://issues.apache.org/jira/browse/ARROW-5278
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C#
>            Reporter: Eric Erhardt
>            Priority: Major
>
> See the discussion [here|https://github.com/apache/arrow/pull/3925/#discussion_r281378027].
> ArrowBuffer currently implement IEquatable, but doesn't override `GetHashCode`.
> We should either implement IEquatable correctly by overriding Equals and GetHashCode, or remove IEquatable all together.
> Looking at ArrowBuffer's [Equals implementation|https://github.com/apache/arrow/blob/08829248fd540b7e3bd96b980e357f8a4db7970e/csharp/src/Apache.Arrow/ArrowBuffer.cs#L66-L69], it compares each value in the buffer, which is not very efficient. Also, this implementation is not consistent with how `Memory<T>` implements IEquatable - [https://source.dot.net/#System.Private.CoreLib/shared/System/Memory.cs,500].
> If we continue implementing IEquatable on ArrowBuffer, we should consider implementing it in the same fashion as Memory<T> does.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)