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

Function ValidateBatch

cpp/src/arrow/record_batch.cc:457–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455namespace {
456
457Status ValidateBatch(const RecordBatch& batch, bool full_validation) {
458 for (int i = 0; i < batch.num_columns(); ++i) {
459 RETURN_NOT_OK(ValidateColumnLength(batch, i));
460 // See ValidateColumnLength about avoiding a ArrayData -> Array conversion
461 const auto& array = *batch.column_data(i);
462 const auto& schema_type = batch.schema()->field(i)->type();
463 if (!array.type->Equals(schema_type)) {
464 return Status::Invalid("Column ", i,
465 " type not match schema: ", array.type->ToString(), " vs ",
466 schema_type->ToString());
467 }
468 const auto st = full_validation ? internal::ValidateArrayFull(array)
469 : internal::ValidateArray(array);
470 if (!st.ok()) {
471 return Status::Invalid("In column ", i, ": ", st.ToString());
472 }
473 }
474 return Status::OK();
475}
476
477} // namespace
478

Callers 2

ValidateMethod · 0.70
ValidateFullMethod · 0.70

Calls 13

ValidateColumnLengthFunction · 0.85
ValidateArrayFullFunction · 0.85
ValidateArrayFunction · 0.85
column_dataMethod · 0.80
InvalidFunction · 0.70
OKFunction · 0.70
num_columnsMethod · 0.45
typeMethod · 0.45
fieldMethod · 0.45
schemaMethod · 0.45
EqualsMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected