mr-smidge commented on a change in pull request #7671: URL: https://github.com/apache/arrow/pull/7671#discussion_r451215646
########## File path: csharp/src/Apache.Arrow/Arrays/BinaryArray.cs ########## @@ -173,11 +245,19 @@ public TBuilder Set(int index, byte value) throw new NotImplementedException(); } + /// <summary> + /// Clear all contents appended so far. + /// </summary> + /// <returns>Returns the builder (for fluent-style composition).</returns> public TBuilder Clear() { ValueOffsets.Clear(); ValueBuffer.Clear(); ValidityBuffer.Clear(); + + // Always write the first offset before anything has been written. + Offset = 0; Review comment: Not resetting the `Offset` member variable was the root cause of the string-clearing bug referenced in ARROW-8344. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org