diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index 0f55fa32a19a7..5abb4b13b114c 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -722,6 +722,7 @@ set(ARROW_COMPUTE_SRCS compute/api_scalar.cc compute/api_vector.cc compute/cast.cc + compute/codegen_internal.cc compute/exec.cc compute/expression.cc compute/function.cc @@ -729,7 +730,6 @@ set(ARROW_COMPUTE_SRCS compute/kernel.cc compute/ordering.cc compute/registry.cc - compute/kernels/codegen_internal.cc compute/kernels/ree_util_internal.cc compute/kernels/scalar_cast_boolean.cc compute/kernels/scalar_cast_dictionary.cc diff --git a/cpp/src/arrow/compute/codegen_internal.cc b/cpp/src/arrow/compute/codegen_internal.cc new file mode 100644 index 0000000000000..ec6214dffc404 --- /dev/null +++ b/cpp/src/arrow/compute/codegen_internal.cc @@ -0,0 +1,34 @@ +// 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/codegen_internal.h" + +#include "arrow/compute/api_vector.h" +#include "arrow/result.h" +#include "arrow/type_fwd.h" + +namespace arrow { +namespace compute { +namespace internal { + +Result FirstType(KernelContext*, const std::vector& types) { + return types.front(); +} + +} // namespace internal +} // namespace compute +} // namespace arrow diff --git a/cpp/src/arrow/compute/codegen_internal.h b/cpp/src/arrow/compute/codegen_internal.h new file mode 100644 index 0000000000000..506eedc0c82c4 --- /dev/null +++ b/cpp/src/arrow/compute/codegen_internal.h @@ -0,0 +1,32 @@ +// 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/api_vector.h" +#include "arrow/result.h" +#include "arrow/type_fwd.h" + +namespace arrow { +namespace compute { +namespace internal { +// ---------------------------------------------------------------------- +// Reusable type resolvers + +Result FirstType(KernelContext*, const std::vector& types); + +} // namespace internal +} // namespace compute +} // namespace arrow diff --git a/cpp/src/arrow/compute/kernels/codegen_internal.cc b/cpp/src/arrow/compute/kernels/codegen_internal.cc index 0fd9cae7a8d71..8d3d93d2b0254 100644 --- a/cpp/src/arrow/compute/kernels/codegen_internal.cc +++ b/cpp/src/arrow/compute/kernels/codegen_internal.cc @@ -49,10 +49,6 @@ const std::vector>& ExampleParametricTypes() { return example_parametric_types; } -Result FirstType(KernelContext*, const std::vector& types) { - return types.front(); -} - Result LastType(KernelContext*, const std::vector& types) { return types.back(); }