MCPcopy Create free account
hub / github.com/apache/arrow / AdjustNonNullable

Function AdjustNonNullable

cpp/src/arrow/array/data.cc:51–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49using internal::CountSetBits;
50
51static inline void AdjustNonNullable(Type::type type_id, int64_t length,
52 std::vector<std::shared_ptr<Buffer>>* buffers,
53 int64_t* null_count) {
54 if (type_id == Type::NA) {
55 *null_count = length;
56 (*buffers)[0] = nullptr;
57 } else if (internal::may_have_validity_bitmap(type_id)) {
58 if (*null_count == 0) {
59 // In case there are no nulls, don't keep an allocated null bitmap around
60 (*buffers)[0] = nullptr;
61 } else if (*null_count == kUnknownNullCount && buffers->at(0) == nullptr) {
62 // Conversely, if no null bitmap is provided, set the null count to 0
63 *null_count = 0;
64 }
65 } else {
66 *null_count = 0;
67 }
68}
69
70namespace internal {
71

Callers 1

MakeMethod · 0.85

Calls 1

may_have_validity_bitmapFunction · 0.85

Tested by

no test coverage detected