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

Method SwapType

cpp/src/arrow/array/util.cc:95–103  ·  view source on GitHub ↗

WARNING: this facility can be called on invalid Array data by the IPC reader. Do not rely on the advertised ArrayData length, instead use the physical buffer sizes to avoid accessing memory out of bounds. (If this guarantee turns out to be difficult to maintain, we should call Validate() instead)

Source from the content-addressed store, hash-verified

93 // (If this guarantee turns out to be difficult to maintain, we should call
94 // Validate() instead)
95 Status SwapType(const DataType& type) {
96 RETURN_NOT_OK(VisitTypeInline(type, this));
97 RETURN_NOT_OK(SwapChildren(type.fields()));
98 if (internal::may_have_validity_bitmap(type.id())) {
99 // Copy null bitmap
100 out_->buffers[0] = data_->buffers[0];
101 }
102 return Status::OK();
103 }
104
105 Status SwapChildren(const FieldVector& child_fields) {
106 for (size_t i = 0; i < child_fields.size(); i++) {

Callers 1

SwapEndianArrayDataFunction · 0.80

Calls 5

VisitTypeInlineFunction · 0.85
may_have_validity_bitmapFunction · 0.85
OKFunction · 0.50
fieldsMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected