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

Method Visit

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

Source from the content-addressed store, hash-verified

47
48 template <typename T>
49 Status Visit(const T&) {
50 if constexpr (std::is_same_v<T, StringType> || std::is_same_v<T, LargeStringType> ||
51 std::is_same_v<T, StringViewType>) {
52 util::InitializeUTF8();
53
54 int64_t i = 0;
55 return VisitArraySpanInline<T>(
56 data,
57 [&](std::string_view v) {
58 if (ARROW_PREDICT_FALSE(!util::ValidateUTF8(v))) {
59 return Status::Invalid("Invalid UTF8 sequence at string index ", i);
60 }
61 ++i;
62 return Status::OK();
63 },
64 [&]() {
65 ++i;
66 return Status::OK();
67 });
68 } else {
69 Unreachable("utf-8 validation of non string type");
70 }
71 }
72};
73
74struct BoundsChecker {

Callers

nothing calls this directly

Calls 5

InitializeUTF8Function · 0.85
UnreachableFunction · 0.85
ValidateUTF8Function · 0.70
InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected