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
- 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.
- links to