[
https://issues.apache.org/jira/browse/ARROW-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rok Mihevc updated ARROW-5278:
------------------------------
External issue URL: https://github.com/apache/arrow/issues/21748
> [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
(v8.20.10#820010)