js8544 commented on code in PR #38632:
URL: https://github.com/apache/arrow/pull/38632#discussion_r1388819476


##########
cpp/src/gandiva/function_registry.cc:
##########
@@ -109,11 +109,35 @@ arrow::Status FunctionRegistry::Register(const 
std::vector<NativeFunction>& func
   return Status::OK();
 }
 
+arrow::Status FunctionRegistry::Register(
+    NativeFunction func, void* c_function_ptr,
+    std::optional<FunctionHolderMaker> function_holder_maker) {
+  if (function_holder_maker.has_value()) {
+    // all signatures should have the same base name, use the first 
signature's base name
+    auto const& func_base_name = func.signatures().begin()->base_name();
+    ARROW_RETURN_NOT_OK(holder_maker_registry_.Register(
+        func_base_name, std::move(function_holder_maker.value())));

Review Comment:
   I think it should be `std::move(function_holder_maker).value()` to make it a 
rvalue



##########
cpp/src/gandiva/expr_decomposer.cc:
##########
@@ -25,11 +25,12 @@
 
 #include "gandiva/annotator.h"
 #include "gandiva/dex.h"
-#include "gandiva/function_holder_registry.h"
+#include "gandiva/function_holder_maker_registry.h"
 #include "gandiva/function_registry.h"
 #include "gandiva/function_signature.h"
 #include "gandiva/in_holder.h"
 #include "gandiva/node.h"
+#include "gandiva/regex_functions_holder.h"

Review Comment:
   Is this include needed?



##########
cpp/src/gandiva/external_c_functions.cc:
##########
@@ -0,0 +1,94 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License
+
+#include "llvm/IR/Type.h"
+
+#include "gandiva/engine.h"
+#include "gandiva/exported_funcs.h"
+
+namespace gandiva {
+static arrow::Result<llvm::Type*> AsLLVMType(const DataTypePtr& from_type,

Review Comment:
   The `LLVMTypes` has a `IRType` function. Can it be reused here?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to