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

Function ValidateUTF8

cpp/src/arrow/array/validate.cc:997–1015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

995Status ValidateArrayFull(const Array& array) { return ValidateArrayFull(*array.data()); }
996
997ARROW_EXPORT
998Status ValidateUTF8(const ArrayData& data) {
999 const auto& storage_type =
1000 (data.type->id() == Type::EXTENSION)
1001 ? checked_cast<const ExtensionType&>(*data.type).storage_type()
1002 : data.type;
1003 DCHECK(storage_type->id() == Type::STRING || storage_type->id() == Type::STRING_VIEW ||
1004 storage_type->id() == Type::LARGE_STRING);
1005
1006 if (data.type->id() == Type::EXTENSION) {
1007 ArrayData ext_data(data);
1008 ext_data.type = storage_type;
1009 UTF8DataValidator validator{ext_data};
1010 return VisitTypeInline(*storage_type, &validator);
1011 } else {
1012 UTF8DataValidator validator{data};
1013 return VisitTypeInline(*storage_type, &validator);
1014 }
1015}
1016
1017ARROW_EXPORT
1018Status ValidateUTF8(const Array& array) { return ValidateUTF8(*array.data()); }

Callers 5

ValidateUTF8Method · 0.70
TestValidateUTF8Method · 0.70
ValidateUTF8Method · 0.70
VisitMethod · 0.70
VisitMethod · 0.70

Calls 4

VisitTypeInlineFunction · 0.85
storage_typeMethod · 0.80
idMethod · 0.45
dataMethod · 0.45

Tested by 2

ValidateUTF8Method · 0.56
TestValidateUTF8Method · 0.56