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

Function ValidateChunks

cpp/src/arrow/chunked_array.cc:262–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260namespace {
261
262Status ValidateChunks(const ArrayVector& chunks, bool full_validation) {
263 if (chunks.size() == 0) {
264 return Status::OK();
265 }
266
267 const auto& type = *chunks[0]->type();
268 // Make sure chunks all have the same type
269 for (size_t i = 1; i < chunks.size(); ++i) {
270 const Array& chunk = *chunks[i];
271 if (!chunk.type()->Equals(type)) {
272 return Status::Invalid("In chunk ", i, " expected type ", type.ToString(),
273 " but saw ", chunk.type()->ToString());
274 }
275 }
276 // Validate the chunks themselves
277 for (size_t i = 0; i < chunks.size(); ++i) {
278 const Array& chunk = *chunks[i];
279 const Status st = full_validation ? internal::ValidateArrayFull(chunk)
280 : internal::ValidateArray(chunk);
281 if (!st.ok()) {
282 return Status::Invalid("In chunk ", i, ": ", st.ToString());
283 }
284 }
285 return Status::OK();
286}
287
288} // namespace
289

Callers 3

ValidateMethod · 0.85
ValidateFullMethod · 0.85
CalculateMethod · 0.85

Calls 9

ValidateArrayFullFunction · 0.85
ValidateArrayFunction · 0.85
OKFunction · 0.70
InvalidFunction · 0.70
sizeMethod · 0.45
typeMethod · 0.45
EqualsMethod · 0.45
ToStringMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected