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

[Java] Allow FixedSizeListVector to have empty children

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0, 2.0.0
    • 3.0.0
    • Java

    Description

      General problem

      FixedSizeListVector was designed to hold a list of lists with data (filled rectangle matrix) but in real life we can have list of empty lists (zero-width matrix). Java implementation of FixedSizeListVector does not allow to create (and read) such list. But in specification there is no any restriction that listSize can not be zero. Also zero-width matrix can be successfully created by C++ implementation. Java fails on reading it. The most problem is that entire table (VectorSchemaRoot) can not be read if we have at least one FixedSizeListVector.listSize==0 field.

      Expected behavior

      • Read zero-width matrix (FixedSizeListVector with listSize==0) written by C++ as zero-width matrix.
      • Read any field from the correct table (written and readable by C++)

      Actual behavior

      • java.lang.IllegalArgumentException: list size must be positive at org.apache.arrow.util.Preconditions.checkArgument(Preconditions.java:136)
      • Filled vectors can not be read if at least one fixed list size is 0

      Examples to reproduce

      Reproduce on creating

      Add
      FixedSizeListVector.empty("ZeroWidthMatrix", 0, new RootAllocator());
      line of code anywhere

      Reproduce on reading

      https://github.com/Kopilov/Arrow_FixedSizeListVector_ZeroWidth repository contains C++ and Java code with GitHub Action workflow that reproduces Actual behavior.
      Here are some logs: https://github.com/Kopilov/Arrow_FixedSizeListVector_ZeroWidth/runs/1363206662 (look "Run C++ example", "Build and run Java example")

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Kopilov Aleksandr Kopilov
              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 - 1h 40m
                  1h 40m