You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jduo (via GitHub)" <gi...@apache.org> on 2025/07/22 19:26:38 UTC

Re: [PR] GH-40347: [C#] ArrowReaderImplementation: fix for out of range exception [arrow]

jduo commented on code in PR #40355:
URL: https://github.com/apache/arrow/pull/40355#discussion_r2223637004


##########
csharp/src/Apache.Arrow/Ipc/ArrowReaderImplementation.cs:
##########
@@ -196,7 +196,8 @@ private List<IArrowArray> BuildArrays(
                     : LoadVariableField(version, ref recordBatchEnumerator, field, in fieldNode, messageBuffer, bufferCreator);
 
                 arrays.Add(ArrowArrayFactory.BuildArray(arrayData));
-            } while (recordBatchEnumerator.MoveNextNode());
+            } while (recordBatchEnumerator.MoveNextNode() && schemaFieldIndex < schema.FieldsList.Count);

Review Comment:
   This seems reasonable however a few questions @davidhcoe -
   - What happens to the state of recordBatchEnumerator if you haven't iterated through all the elements? Do you have to manually close it?
   - Similarly, what happens if you exhaust the recordBatchEnumerator before reaching the field list count? Do fields beyond this get exposed correctly?
   



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org