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

Method ValidateOverflow

cpp/src/arrow/array/builder_nested.cc:225–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225Status FixedSizeListBuilder::ValidateOverflow(int64_t new_elements) {
226 auto new_length = value_builder_->length() + new_elements;
227 if (new_elements != list_size_) {
228 return Status::Invalid("Length of item not correct: expected ", list_size_,
229 " but got array of size ", new_elements);
230 }
231 if (new_length > maximum_elements()) {
232 return Status::CapacityError("array cannot contain more than ", maximum_elements(),
233 " elements, have ", new_elements);
234 }
235 return Status::OK();
236}
237
238Status FixedSizeListBuilder::AppendEmptyValue() {
239 RETURN_NOT_OK(Reserve(1));

Callers 5

AppendSequenceMethod · 0.45
AppendNdarrayMethod · 0.45
TestOverflowCheckMethod · 0.45
TestOverflowCheckMethod · 0.45
ExtendMethod · 0.45

Calls 5

maximum_elementsFunction · 0.85
CapacityErrorFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50
lengthMethod · 0.45

Tested by 2

TestOverflowCheckMethod · 0.36
TestOverflowCheckMethod · 0.36