You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Takashi Hashida (Jira)" <ji...@apache.org> on 2020/03/16 05:04:00 UTC

[jira] [Updated] (ARROW-8128) [C#] NestedType values serialized on wrong length

     [ https://issues.apache.org/jira/browse/ARROW-8128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Takashi Hashida updated ARROW-8128:
-----------------------------------
    Description: 
NestedType values are serialized on parent node Length and NullCount.

 

[https://github.com/apache/arrow/blob/master/csharp/src/Apache.Arrow/Ipc/ArrowReaderImplementation.cs#L219]

 
{code:java}
Flatbuf.FieldNode childFieldNode = recordBatchEnumerator.CurrentNode;
recordBatchEnumerator.MoveNextNode();
{code}
At this lines, MoveNextNode should be executed before assigning CurrentNode.

this can be reproduced by changing TestData.ArrayCreator.Visit(ListType type) like below and execute ArrowFileReaderTests.
{code:java}
public void Visit(ListType type)
 {
 var builder = new ListArray.Builder(type.ValueField).Reserve(Length);

//Todo : Support various types
 var valueBuilder = (Int64Array.Builder)builder.ValueBuilder.Reserve(Length);

for (var i = 0; i < Length; i++)
 {
 builder.Append();
 valueBuilder.Append(i);
 }

//Add a value to check if Values length can exceed ListArray length
 valueBuilder.Append(0);

Array = builder.Build();
 }
{code}

  was:
NestedType Values is serialized on parent node Length and NullCount.

 

[https://github.com/apache/arrow/blob/master/csharp/src/Apache.Arrow/Ipc/ArrowReaderImplementation.cs#L219]

 

{code}
Flatbuf.FieldNode childFieldNode = recordBatchEnumerator.CurrentNode;
recordBatchEnumerator.MoveNextNode();
{code}

At this lines, MoveNextNode should be executed before assigning CurrentNode.

this can be reproduced by changing TestData.ArrayCreator.Visit(ListType type) like below and execute ArrowFileReaderTests.

{code}
public void Visit(ListType type)
 {
 var builder = new ListArray.Builder(type.ValueField).Reserve(Length);

//Todo : Support various types
 var valueBuilder = (Int64Array.Builder)builder.ValueBuilder.Reserve(Length);

for (var i = 0; i < Length; i++)
 {
 builder.Append();
 valueBuilder.Append(i);
 }

//Add a value to check if Values length can exceed ListArray length
 valueBuilder.Append(0);

Array = builder.Build();
 }
{code}


> [C#] NestedType values serialized on wrong length
> -------------------------------------------------
>
>                 Key: ARROW-8128
>                 URL: https://issues.apache.org/jira/browse/ARROW-8128
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C#
>            Reporter: Takashi Hashida
>            Priority: Major
>
> NestedType values are serialized on parent node Length and NullCount.
>  
> [https://github.com/apache/arrow/blob/master/csharp/src/Apache.Arrow/Ipc/ArrowReaderImplementation.cs#L219]
>  
> {code:java}
> Flatbuf.FieldNode childFieldNode = recordBatchEnumerator.CurrentNode;
> recordBatchEnumerator.MoveNextNode();
> {code}
> At this lines, MoveNextNode should be executed before assigning CurrentNode.
> this can be reproduced by changing TestData.ArrayCreator.Visit(ListType type) like below and execute ArrowFileReaderTests.
> {code:java}
> public void Visit(ListType type)
>  {
>  var builder = new ListArray.Builder(type.ValueField).Reserve(Length);
> //Todo : Support various types
>  var valueBuilder = (Int64Array.Builder)builder.ValueBuilder.Reserve(Length);
> for (var i = 0; i < Length; i++)
>  {
>  builder.Append();
>  valueBuilder.Append(i);
>  }
> //Add a value to check if Values length can exceed ListArray length
>  valueBuilder.Append(0);
> Array = builder.Build();
>  }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)