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

Method WriteValidityField

cpp/src/arrow/integration/json_internal.cc:726–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724 }
725
726 void WriteValidityField(const Array& arr) {
727 writer_->Key("VALIDITY");
728 writer_->StartArray();
729 if (arr.null_count() > 0) {
730 for (int i = 0; i < arr.length(); ++i) {
731 writer_->Int(arr.IsNull(i) ? 0 : 1);
732 }
733 } else {
734 for (int i = 0; i < arr.length(); ++i) {
735 writer_->Int(1);
736 }
737 }
738 writer_->EndArray();
739 }
740
741 void SetNoChildren() {
742 // Nothing. We used to write an empty "children" array member,

Callers

nothing calls this directly

Calls 7

KeyMethod · 0.45
StartArrayMethod · 0.45
null_countMethod · 0.45
lengthMethod · 0.45
IntMethod · 0.45
IsNullMethod · 0.45
EndArrayMethod · 0.45

Tested by

no test coverage detected