Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0, 2.0.0
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
- links to