Skip to content

StructBuilder::AppendNull() Should Use AppendNull() for Children Instead of AppendEmpty() #48646

@yannan-wyn

Description

@yannan-wyn

StructBuilder::AppendNull() Should Use AppendNull() for Children Instead of AppendEmpty()

  1. The current implementation of StructBuilder appends empty to each child vector for each appended null.
  2. In some scenarios, I try to extract child[0], and theoretically, the row that was appended as null should also be null. However, this is not the case in practice (because the current implementation uses AppendEmpty for child arrays).
    I would like to rewrite the code like this:

Status AppendNull() final {
for (const auto& field : children_) {
ARROW_RETURN_NOT_OK(field->AppendNull());
}
return Append(false);
}

Component(s)

C++

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions