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

Function ValidateColumnLength

cpp/src/arrow/record_batch.cc:268–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266namespace {
267
268Status ValidateColumnLength(const RecordBatch& batch, int i) {
269 // This function is part of the validation code path and should
270 // be robust against invalid data, but `column()` would call MakeArray()
271 // that can abort on invalid data.
272 const auto& array = *batch.column_data(i);
273 if (ARROW_PREDICT_FALSE(array.length != batch.num_rows())) {
274 return Status::Invalid("Number of rows in column ", i,
275 " did not match batch: ", array.length, " vs ",
276 batch.num_rows());
277 }
278 return Status::OK();
279}
280
281} // namespace
282

Callers 2

ToStructArrayMethod · 0.85
ValidateBatchFunction · 0.85

Calls 4

column_dataMethod · 0.80
InvalidFunction · 0.70
OKFunction · 0.70
num_rowsMethod · 0.45

Tested by

no test coverage detected