Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-8128

[C#] NestedType children serialized on wrong length

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.17.0
    • C#

    Description

      Each node of NestedType children is serialized on a previous node Length and NullCount.

      This causes wrong data access at ListArray.GetValueOffset and so on.

       

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

       

      Flatbuf.FieldNode childFieldNode = recordBatchEnumerator.CurrentNode;
      recordBatchEnumerator.MoveNextNode();
      

      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.

      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();
       }
      

      Attachments

        Issue Links

          Activity

            People

              HashidaTKS Takashi Hashida
              HashidaTKS Takashi Hashida
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m