| 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 | |
| 74 | struct BoundsChecker { |
nothing calls this directly
no test coverage detected