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

Function ValidateColumnLength

cpp/src/arrow/record_batch.cc:267–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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