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

Function ValidateBatch

cpp/src/arrow/record_batch.cc:458–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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