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

Function ValidateChunks

cpp/src/arrow/chunked_array.cc:250–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248namespace {
249
250Status ValidateChunks(const ArrayVector& chunks, bool full_validation) {
251 if (chunks.size() == 0) {
252 return Status::OK();
253 }
254
255 const auto& type = *chunks[0]->type();
256 // Make sure chunks all have the same type
257 for (size_t i = 1; i < chunks.size(); ++i) {
258 const Array& chunk = *chunks[i];
259 if (!chunk.type()->Equals(type)) {
260 return Status::Invalid("In chunk ", i, " expected type ", type.ToString(),
261 " but saw ", chunk.type()->ToString());
262 }
263 }
264 // Validate the chunks themselves
265 for (size_t i = 0; i < chunks.size(); ++i) {
266 const Array& chunk = *chunks[i];
267 const Status st = full_validation ? internal::ValidateArrayFull(chunk)
268 : internal::ValidateArray(chunk);
269 if (!st.ok()) {
270 return Status::Invalid("In chunk ", i, ": ", st.ToString());
271 }
272 }
273 return Status::OK();
274}
275
276} // namespace
277

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