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

Method WriteValidityField

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

Source from the content-addressed store, hash-verified

725 }
726
727 void WriteValidityField(const Array& arr) {
728 writer_->Key("VALIDITY");
729 writer_->StartArray();
730 if (arr.null_count() > 0) {
731 for (int i = 0; i < arr.length(); ++i) {
732 writer_->Int(arr.IsNull(i) ? 0 : 1);
733 }
734 } else {
735 for (int i = 0; i < arr.length(); ++i) {
736 writer_->Int(1);
737 }
738 }
739 writer_->EndArray();
740 }
741
742 void SetNoChildren() {
743 // 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