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

Function CheckCapacity

cpp/src/arrow/array/builder_base.h:285–297  ·  view source on GitHub ↗

Check the requested capacity for validity

Source from the content-addressed store, hash-verified

283
284 // Check the requested capacity for validity
285 Status CheckCapacity(int64_t new_capacity) {
286 if (ARROW_PREDICT_FALSE(new_capacity < 0)) {
287 return Status::Invalid(
288 "Resize capacity must be positive (requested: ", new_capacity, ")");
289 }
290
291 if (ARROW_PREDICT_FALSE(new_capacity < length_)) {
292 return Status::Invalid("Resize cannot downsize (requested: ", new_capacity,
293 ", current length: ", length_, ")");
294 }
295
296 return Status::OK();
297 }
298
299 // Check for array type
300 Status CheckArrayType(const std::shared_ptr<DataType>& expected_type,

Callers 11

ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeMethod · 0.85
ResizeFunction · 0.85

Calls 2

InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected