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

Function ValidateUTF8

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

Source from the content-addressed store, hash-verified

1001Status ValidateArrayFull(const Array& array) { return ValidateArrayFull(*array.data()); }
1002
1003ARROW_EXPORT
1004Status ValidateUTF8(const ArrayData& data) {
1005 const auto& storage_type =
1006 (data.type->id() == Type::EXTENSION)
1007 ? checked_cast<const ExtensionType&>(*data.type).storage_type()
1008 : data.type;
1009 DCHECK(storage_type->id() == Type::STRING || storage_type->id() == Type::STRING_VIEW ||
1010 storage_type->id() == Type::LARGE_STRING);
1011
1012 if (data.type->id() == Type::EXTENSION) {
1013 ArrayData ext_data(data);
1014 ext_data.type = storage_type;
1015 UTF8DataValidator validator{ext_data};
1016 return VisitTypeInline(*storage_type, &validator);
1017 } else {
1018 UTF8DataValidator validator{data};
1019 return VisitTypeInline(*storage_type, &validator);
1020 }
1021}
1022
1023ARROW_EXPORT
1024Status 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