| 1918 | struct CountSubstringExec { |
| 1919 | using OffsetType = typename TypeTraits<InputType>::OffsetType; |
| 1920 | static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) { |
| 1921 | const MatchSubstringOptions& options = MatchSubstringState::Get(ctx); |
| 1922 | if (options.ignore_case) { |
| 1923 | #ifdef ARROW_WITH_RE2 |
| 1924 | const bool is_utf8 = is_string_or_string_view(batch[0].type()->id()); |
| 1925 | ARROW_ASSIGN_OR_RAISE(auto counter, CountSubstringRegex::Make(options, is_utf8, |
| 1926 | /*literal=*/true)); |
| 1927 | applicator::ScalarUnaryNotNullStateful<OffsetType, InputType, CountSubstringRegex> |
| 1928 | kernel{std::move(counter)}; |
| 1929 | return kernel.Exec(ctx, batch, out); |
| 1930 | #else |
| 1931 | return Status::NotImplemented("ignore_case requires RE2"); |
| 1932 | #endif |
| 1933 | } |
| 1934 | applicator::ScalarUnaryNotNullStateful<OffsetType, InputType, CountSubstring> kernel{ |
| 1935 | CountSubstring(PlainSubstringMatcher(options))}; |
| 1936 | return kernel.Exec(ctx, batch, out); |
| 1937 | } |
| 1938 | }; |
| 1939 | |
| 1940 | const FunctionDoc count_substring_doc( |
nothing calls this directly
no test coverage detected