Skip to content

JSON Reader Scalar to List Promotion Always NULL #3601

@tustvold

Description

@tustvold

Describe the bug

Decoder contains logic to promote a scalar value to a list, however, the logic that does so does not set the validity on the parent array.

if let Value::Array(a) = v {
    cur_offset += OffsetSize::from_usize(a.len()).unwrap();
    bit_util::set_bit(list_nulls, i);
} else if let Value::Null = v {
    // value is null, not incremented
} else {
    cur_offset += OffsetSize::one();
}

As such the resulting slices are always null

To Reproduce

Column d of mixed_arrays.json has a null count of 3 in the output, instead of 1.

Expected behavior

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions