adamreeve commented on code in PR #291:
URL: https://github.com/apache/arrow-dotnet/pull/291#discussion_r2991950538


##########
src/Apache.Arrow/ChunkedArray.cs:
##########
@@ -64,12 +64,12 @@ public ChunkedArray Slice(long offset, long length)
         {
             if (offset >= Length)
             {
-                throw new ArgumentException($"Index {offset} cannot be greater 
than the Column's Length {Length}");
+                throw new ArgumentException($"Offset {offset} cannot be 
greater than Length {Length} for ChunkedArray.Slice");
             }
 
             int curArrayIndex = 0;
             int numArrays = Arrays.Count;
-            while (curArrayIndex < numArrays && offset > 
Arrays[curArrayIndex].Length)
+            while (curArrayIndex < numArrays && offset >= 
Arrays[curArrayIndex].Length)

Review Comment:
   Ah I thought this would lead to incorrect results. I now see CoPilot's 
explanation that it just results in an empty chunk, which isn't so bad. But 
still nice to fix.



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