adamreeve commented on code in PR #41144:
URL: https://github.com/apache/arrow/pull/41144#discussion_r1561651870
##########
csharp/src/Apache.Arrow/Arrays/ArrayData.cs:
##########
@@ -28,12 +27,25 @@ public sealed class ArrayData : IDisposable
public readonly IArrowType DataType;
public readonly int Length;
- public readonly int NullCount;
+ private int _nullCount;
public readonly int Offset;
public readonly ArrowBuffer[] Buffers;
public readonly ArrayData[] Children;
public readonly ArrayData Dictionary; // Only used for dictionary type
+ public int NullCount
Review Comment:
Yeah OK, maybe a `GetNullCount` method instead would make sense, partly
because I can't think of a better property name, but then it's also obvious it
might do more work than a plain member access.
I guess we also don't necessarily need to deprecate the existing member
because there might be cases where users only want the null count if it can be
accessed quickly and don't want to pay the cost of computing it, so we could
just document that it may return a negative number. And we could remove the
`readonly` modifier to allow updating it if `GetNullCount` is called, which
isn't a breaking change according to [the
rules](https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules#members).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]