You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Adam Szmigin (Jira)" <ji...@apache.org> on 2020/05/21 22:13:00 UTC
[jira] [Created] (ARROW-8886) [C#] Decide and implement appropriate
behaviour for Array builder resize to negative size
Adam Szmigin created ARROW-8886:
-----------------------------------
Summary: [C#] Decide and implement appropriate behaviour for Array builder resize to negative size
Key: ARROW-8886
URL: https://issues.apache.org/jira/browse/ARROW-8886
Project: Apache Arrow
Issue Type: Improvement
Components: C#
Affects Versions: 0.17.1
Reporter: Adam Szmigin
h1. Summary
Currently, the {{ArrowBuffer.Builder}} class accepts a negative value to the {{Resize()}} method, and treats it as though the caller passed zero. This was implemented deliberately, as there is an explicit unit test to verify the behaviour.
However, it is also unusual. By way of comparison:
* The {{System.Array.Resize<T>()}} method throws {{ArgumentOutOfRangeException}} if a negative value is passed: https://docs.microsoft.com/en-us/dotnet/api/system.array.resize?view=netcore-3.1
* The Arrow C++ implementation will refuse to accept a negative length: https://github.com/apache/arrow/blob/master/cpp/src/arrow/array/builder_base.h#L194
h1. Acceptance Criteria
* The behaviour when receiving a negative length to a {{Resize()}} method _must_ be agreed upon.
* Appropriate changes _must_ be made to the codebase in accordance with the outcome of the above agreement.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)