apache / apache/arrow

[C++] StructBuilder::AppendNull() Should Use AppendNull() for Children Instead of AppendEmpty()

Open
#48,646 1 comment 0 reactions 0 assignees View on GitHub
Component: C++ Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### 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++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.