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

Function CheckCapacity

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

Check the requested capacity for validity

Source from the content-addressed store, hash-verified

273
274 // Check the requested capacity for validity
275 Status CheckCapacity(int64_t new_capacity) {
276 if (ARROW_PREDICT_FALSE(new_capacity < 0)) {
277 return Status::Invalid(
278 "Resize capacity must be positive (requested: ", new_capacity, ")");
279 }
280
281 if (ARROW_PREDICT_FALSE(new_capacity < length_)) {
282 return Status::Invalid("Resize cannot downsize (requested: ", new_capacity,
283 ", current length: ", length_, ")");
284 }
285
286 return Status::OK();
287 }
288
289 // Check for array type
290 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