Skip to content

Commit

Permalink
Move problematic function to compute/codegen_internal instead of comp…
Browse files Browse the repository at this point in the history
…ute/kernels/codegen_internal
  • Loading branch information
raulcd committed Feb 27, 2025
1 parent d6a7828 commit bc6839e
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,14 @@ 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
compute/function_internal.cc
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
Expand Down
34 changes: 34 additions & 0 deletions cpp/src/arrow/compute/codegen_internal.cc
Original file line number Diff line number Diff line change
@@ -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<TypeHolder> FirstType(KernelContext*, const std::vector<TypeHolder>& types) {
return types.front();
}

} // namespace internal
} // namespace compute
} // namespace arrow
32 changes: 32 additions & 0 deletions cpp/src/arrow/compute/codegen_internal.h
Original file line number Diff line number Diff line change
@@ -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<TypeHolder> FirstType(KernelContext*, const std::vector<TypeHolder>& types);

} // namespace internal
} // namespace compute
} // namespace arrow
4 changes: 0 additions & 4 deletions cpp/src/arrow/compute/kernels/codegen_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ const std::vector<std::shared_ptr<DataType>>& ExampleParametricTypes() {
return example_parametric_types;
}

Result<TypeHolder> FirstType(KernelContext*, const std::vector<TypeHolder>& types) {
return types.front();
}

Result<TypeHolder> LastType(KernelContext*, const std::vector<TypeHolder>& types) {
return types.back();
}
Expand Down

0 comments on commit bc6839e

Please sign in to comment.