twest822 commented on issue #410:
URL: https://github.com/apache/arrow-dotnet/issues/410#issuecomment-5274906473

   Repro's just calling the getter on `Values`. There is perhaps a related 
issue in that `ArrayData..ctor()` doesn't validate the caller provided `length` 
is compatible with the caller provided `ArrowBuffer`s anywhere I'm seeing. I'll 
audit that in the call graph I'm working under but, due to some other tasks 
needing attention, it'll likely be next week to get back to it.
   
   > Maybe we just need to improve the documentation to note that Length and 
Offset are in terms of array values, not bytes?
   
   If that's the design intent documenting (and covering argument validation 
with error cases in the unit tests) makes good sense to me. FWIW, I usually try 
to include units in variable names where practical. So, for example, if 
`length` were intended to be `lengthInBytes` that'd be an easy supporting 
change. I'm not sure what to use here, though. `lengthInTs` is pretty awkward 
and `lengthInValues` isn't especially clear. Maybe somebody'll have a better 
idea in this direction.
   
   A corollary might be also documenting `ArrowBuffer.Length` is in bytes.


-- 
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]

Reply via email to