Skip to content

apply() nullability bug #7878

@connortsui20

Description

@connortsui20

What happened?

apply() has a bug with null propagation from struct validity to non-nullable child fields.

This test should pass, but it panics now.

vortex-array/src/scalar_fn/fns/get_item.rs
    fn get_nullable_field() {
        let st = StructArray::try_new(
            FieldNames::from(["a"]),
            vec![buffer![1i32].into_array()],
            1,
            Validity::AllInvalid,
        )
        .unwrap()
        .into_array();

        let get_item_expr = get_item("a", root());
        let item = st.apply(&get_item_expr).unwrap();
        // The dtype should be nullable since it inherits struct validity
        assert_eq!(
            item.dtype(),
            &DType::Primitive(PType::I32, Nullability::Nullable)
        );
    }

Steps to reproduce

See tests above

Environment

All environments

Additional context

#7844

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions