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

[Java] UnionListWriter does not behave properly when multiple lists are written in the same list

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Java
    • Labels:
      None

      Description

      if you run the following code:

          ListVector listVector = new ListVector("list", allocator, null);
          listVector.allocateNew();
          UnionListWriter listWriter = new UnionListWriter(listVector);
      
          listWriter.start();
          listWriter.startList();
      
          listWriter.list("a").startList();
          listWriter.list("a").bigInt().writeBigInt(1);
          listWriter.list("a").bigInt().writeBigInt(2);
          listWriter.list("a").bigInt().writeBigInt(3);
          listWriter.list("a").endList();
      
          listWriter.list("a").startList();
          listWriter.list("a").bigInt().writeBigInt(4);
          listWriter.list("a").bigInt().writeBigInt(5);
          listWriter.list("a").endList();
      
          listWriter.endList();
          listWriter.end();
      
          listWriter.setValueCount(1);
      

      listVector will contain:

      [{"a":[1,2,3,4,5]}]
      

      Instead of

      [{"a":[1,2,3],[4,5]}]
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adeneche Abdel Hakim Deneche
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: