'Lengths and null_counts for children arrays of Structs in JavaScript apache-arrow

I've encountered a peculiar case to do with null values of a FixedSizeList within a Struct.

Little bit of context

Using the Builder in the JS apache-arrow package seems to result in values that don't align with how I think the spec is laid out. We have a type that's a Struct with a single field that's a FixedSizeList (of length 2 with values of u64).

When we append null to the Builder, the resultant column should be [null]. What is strange to me though, is that the Builder specifies the top level node as having length 1 (as expected as there is 1 null Struct), but then the FixedSizeList node has length: 0 and null_values: 0.

The Arrow docs for Struct types suggest that the length of the children arrays should be equal to the length of the struct array.

So all of that is to ask,

Shouldn't the FixedSizeList child array be of length: 1 with null_values: 1?

The builder looks like the following info (I've removed some fields for brevity):

{
    "length": 1,
    "finished": false,
    "type": {
        "children": [
            {
                "name": "foo",
                "type": {
                    "listSize": 2,
                    "children": [
                        {
                            "name": null,
                            "type": {
                                "precision": 2
                            },
                            "nullable": false,
                            "metadata": {}
                        }
                    ]
                },
                "nullable": true,
                "metadata": {}
            }
        ],
        "is_any": false
    },
    "children": [
        {
            "length": 0,
            "finished": false,
            "type": {
                "listSize": 2,
                "children": [
                    {
                        "name": null,
                        "type": {
                            "precision": 2
                        },
                        "nullable": false,
                        "metadata": {}
                    }
                ]
            },
            "children": [
                {
                    "length": 0,
                    "finished": false,
                    "type": {
                        "precision": 2
                    },
                    "children": [],
                    "nullValues": [
                        null,
                        null
                    ],
                    ...
                }
            ],
            "nullValues": [
                null,
                null
            ],
            ...
        }
    ],
    "nullValues": [
        null,
        null
    ],
    ...
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source