raulcd commented on code in PR #46261:
URL: https://github.com/apache/arrow/pull/46261#discussion_r2131802445


##########
cpp/src/arrow/compute/initialize.cc:
##########
@@ -0,0 +1,90 @@
+// 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 "arrow/compute/initialize.h"
+#include "arrow/compute/registry.h"
+
+#include <algorithm>
+#include <memory>
+#include <mutex>
+#include <unordered_map>
+#include <utility>
+
+#include "arrow/compute/function.h"
+#include "arrow/compute/function_internal.h"
+#include "arrow/compute/registry_internal.h"
+#include "arrow/status.h"
+#include "arrow/util/config.h"  // For ARROW_COMPUTE
+#include "arrow/util/logging.h"
+
+namespace arrow::compute {
+namespace internal {
+
+Status RegisterComputeKernels() {
+  auto registry = GetFunctionRegistry();
+
+  // Register additional kernels on libarrow_compute
+  // Scalar functions
+  internal::RegisterScalarArithmetic(registry);

Review Comment:
   Yes, as @zanmato1984 points, this is the case.
   The function pointed won't be compiled if `ARROW_COMPUTE=OFF`. The 
`initialize.cc` file only gets compiled if `ARROW_COMPUTE=ON` and into 
`libarrow_compute.so`. The Scalar Arithmetic kernels (on this case) will only 
be available after calling `arrow::compute::Initialize()` and those must have 
compiled `libarrow_compute.so` for the symbol to be available.
   
   Having those kernels available only if `ARROW_COMPUTE=ON` was also the case 
previously, the difference is the requirement to link to `libarrow_compute.so` 
and calling the function.



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