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

Method Exec

cpp/src/arrow/compute/kernels/scalar_string_ascii.cc:1920–1937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1918struct 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
1940const FunctionDoc count_substring_doc(

Callers

nothing calls this directly

Calls 8

is_string_or_string_viewFunction · 0.85
CountSubstringClass · 0.85
GetFunction · 0.50
NotImplementedFunction · 0.50
idMethod · 0.45
typeMethod · 0.45
ExecMethod · 0.45

Tested by

no test coverage detected