You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/14 15:55:39 UTC

[GitHub] [arrow] xhochy commented on a change in pull request #7755: ARROW-9390: [C++][Doc] Review compute function names

xhochy commented on a change in pull request #7755:
URL: https://github.com/apache/arrow/pull/7755#discussion_r454462566



##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -385,35 +371,34 @@ void TransformBinaryContainsExact(const uint8_t* pattern, int64_t pattern_length
   bitmap_writer.Finish();
 }
 
-using BinaryContainsExactState = OptionsWrapper<BinaryContainsExactOptions>;
+using MatchSubstringState = OptionsWrapper<MatchSubstringOptions>;
 
 template <typename Type>
-struct BinaryContainsExact {
+struct MatchSubstring {
   using offset_type = typename Type::offset_type;
   static void Exec(KernelContext* ctx, const ExecBatch& batch, Datum* out) {
-    BinaryContainsExactOptions arg = BinaryContainsExactState::Get(ctx);
+    MatchSubstringOptions arg = MatchSubstringState::Get(ctx);
     const uint8_t* pat = reinterpret_cast<const uint8_t*>(arg.pattern.c_str());
     const int64_t pat_size = arg.pattern.length();
     StringBoolTransform<Type>(
         ctx, batch,
         [pat, pat_size](const void* offsets, const uint8_t* data, int64_t length,
                         int64_t output_offset, uint8_t* output) {
-          TransformBinaryContainsExact<offset_type>(
+          TransformMatchSubstring<offset_type>(
               pat, pat_size, reinterpret_cast<const offset_type*>(offsets), data, length,
               output_offset, output);
         },
         out);
   }
 };
 
-void AddBinaryContainsExact(FunctionRegistry* registry) {
-  auto func = std::make_shared<ScalarFunction>("binary_contains_exact", Arity::Unary());
-  auto exec_32 = BinaryContainsExact<StringType>::Exec;
-  auto exec_64 = BinaryContainsExact<LargeStringType>::Exec;
+void AddMatchSubstring(FunctionRegistry* registry) {

Review comment:
       Yes, this is fine with me.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org