[
https://issues.apache.org/jira/browse/ARROW-8110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17059180#comment-17059180
]
Takashi Hashida commented on ARROW-8110:
----------------------------------------
This error occurs when a user uses a NestedType column which is *not* at the
end of RecordBatch columns.
If RecordBatch columns have only one NestedType column and it is at the end of
the columns, this error does not occur because this do-while loop breaks before
executing GetFieldByIndex on a wrong index.
This is reproduced by changing the order of a ListType column in
CreateSampleRecordBatch and executing ArrowFileReaderTests.
{code}
public static RecordBatch CreateSampleRecordBatch(int length, int
columnSetCount)
{
Schema.Builder builder = new Schema.Builder();
for (int i = 0; i < columnSetCount; i++)
{
...
builder.Field(CreateField(TimestampType.Default, i));
//Change the order so that a ListType column does not end of
columns
builder.Field(CreateField(new ListType(Int64Type.Default), i));
builder.Field(CreateField(StringType.Default, i));
}
...
}
{code}
> [C#] BuildArrays fails if NestedType is included
> ------------------------------------------------
>
> Key: ARROW-8110
> URL: https://issues.apache.org/jira/browse/ARROW-8110
> Project: Apache Arrow
> Issue Type: Bug
> Components: C#
> Reporter: Takashi Hashida
> Priority: Major
>
> https://github.com/apache/arrow/blob/master/csharp/src/Apache.Arrow/Ipc/ArrowReaderImplementation.cs#L128
> {code}
> var field =
> schema.GetFieldByIndex(recordBatchEnumerator.CurrentNodeIndex);
> {code}
> Flatbuf.RecordBatch.Nodes include child nodes but Schmea._fileds do not
> include child fileds.
> If a NestedType array is included in the Nodes, CurrentNodeIndex exceeds
> fileds length and GetFieldByIndex throws an ArgumentOutOfRange exception.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)