kou commented on code in PR #45618:
URL: https://github.com/apache/arrow/pull/45618#discussion_r1978393556
##########
cpp/examples/arrow/compute_and_write_csv_example.cc:
##########
@@ -22,6 +22,7 @@
#include <arrow/io/api.h>
#include <arrow/result.h>
#include <arrow/status.h>
+#include "arrow/compute/kernels/registry.h"
Review Comment:
Could you use `<...>` for external headers? (Arrow headers are external
headers for example codes.)
```suggestion
#include <arrow/compute/kernels/registry.h>
```
##########
cpp/examples/tutorial_examples/CMakeLists.txt:
##########
@@ -37,7 +37,8 @@ target_link_libraries(file_access_example PRIVATE
Arrow::arrow_shared
Parquet::parquet_shared)
add_executable(compute_example compute_example.cc)
-target_link_libraries(compute_example PRIVATE Arrow::arrow_shared)
+target_link_libraries(compute_example PRIVATE Arrow::arrow_shared
+
ArrowCompute::arrow_compute_shared)
Review Comment:
We don't need `Arrow::arrow_shared` here because
`ArrowCompute::arrow_compute_shared` has `Arrow::arrow_shared` dependency:
```suggestion
target_link_libraries(compute_example PRIVATE
ArrowCompute::arrow_compute_shared)
```
##########
cpp/src/arrow/compute/CMakeLists.txt:
##########
@@ -18,6 +18,7 @@
add_custom_target(arrow-compute-tests)
arrow_install_all_headers("arrow/compute")
+arrow_install_all_headers("arrow/compute/kernels")
Review Comment:
Could you remove this to `cpp/src/arrow/compute/kernels/CMakeLists.txt` to
install `arrow/compute/kernels/registry.h` to
`${PREFIX}/include/arrow/compute/kernels/registry.h`?
If we use this here, `cpp/src/arrow/compute/registry.h` not
`cpp/src/arrow/compute/kernels/registry.h` is installed
`${PREFIX}/include/arrow/compute/kernels/registry.h`.
##########
cpp/src/arrow/compute/kernels/registry.h:
##########
@@ -0,0 +1,29 @@
+// 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/registry.h"
+
+#include "arrow/compute/visibility.h"
+#include "arrow/status.h"
+// TODO: Review includes
+
+namespace arrow {
+namespace compute {
Review Comment:
Could you nested namespaces? See also:
https://github.com/apache/arrow/issues/36620
```suggestion
namespace arrow::compute {
```
##########
cpp/src/arrow/compute/kernels/registry.h:
##########
@@ -0,0 +1,29 @@
+// 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/registry.h"
Review Comment:
Could you add `#pragma once`?
```suggestion
#pragma once
#include "arrow/compute/registry.h"
```
##########
cpp/src/arrow/compute/visibility.h:
##########
@@ -0,0 +1,48 @@
+// 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.
+
+#pragma once
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+# if defined(_MSC_VER)
+# pragma warning(push)
+# pragma warning(disable : 4251)
+# else
+# pragma GCC diagnostic ignored "-Wattributes"
+# endif
+
+# ifdef ARROW_COMPUTE_STATIC
+# define ARROW_COMPUTE_EXPORT
+# elif defined(ARROW_COMPUTE_EXPORTING)
+# define ARROW_COMPUTE_EXPORT __declspec(dllexport)
+# else
+# define ARROW_COMPUTE_EXPORT __declspec(dllimport)
+# endif
+
+# define ARROW_COMPUTE_NO_EXPORT
+#else // Not Windows
+# ifndef ARROW_COMPUTE_EXPORT
+# define ARROW_COMPUTE_EXPORT __attribute__((visibility("default")))
+# endif
+# ifndef ARROW_COMPUTE_NO_EXPORT
+# define ARROW_COMPUTE_NO_EXPORT __attribute__((visibility("hidden")))
+# endif
+#endif // Not-Windows
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif
Review Comment:
Could you move this to `#if defined(_WIN32) || defined(__CYGWIN__)` clause?
--
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]