| 265 | namespace { |
| 266 | |
| 267 | Status 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 |
no test coverage detected