You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by za...@apache.org on 2026/07/27 17:45:10 UTC
(arrow) 01/01: GH-50624: Clarify case_when constraint ownership
This is an automated email from the ASF dual-hosted git repository.
zanmato1984 pushed a commit to branch codex/case-when-parameterized-exact-dispatch
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit 1b94c044ac13cc90ddd9f1bbe6ee2d1ae059e20b
Author: Rossi Sun <za...@gmail.com>
AuthorDate: Mon Jul 27 10:44:52 2026 -0700
GH-50624: Clarify case_when constraint ownership
---
cpp/src/arrow/compute/kernels/scalar_if_else.cc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/cpp/src/arrow/compute/kernels/scalar_if_else.cc b/cpp/src/arrow/compute/kernels/scalar_if_else.cc
index a4bccfef108..0b286a55e36 100644
--- a/cpp/src/arrow/compute/kernels/scalar_if_else.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_if_else.cc
@@ -2736,10 +2736,10 @@ struct ChooseFunction : ScalarFunction {
void AddCaseWhenKernel(const std::shared_ptr<CaseWhenFunction>& scalar_function,
detail::GetTypeId get_id, ArrayKernelExec exec,
- std::shared_ptr<MatchConstraint> constraint) {
+ const std::shared_ptr<MatchConstraint>& constraint) {
ScalarKernel kernel(
KernelSignature::Make({InputType(Type::STRUCT), InputType(get_id.id)}, LastType,
- /*is_varargs=*/true, std::move(constraint)),
+ /*is_varargs=*/true, constraint),
exec);
if (is_fixed_width(get_id.id)) {
kernel.null_handling = NullHandling::COMPUTED_PREALLOCATE;
@@ -2755,7 +2755,7 @@ void AddCaseWhenKernel(const std::shared_ptr<CaseWhenFunction>& scalar_function,
void AddPrimitiveCaseWhenKernels(const std::shared_ptr<CaseWhenFunction>& scalar_function,
const std::vector<std::shared_ptr<DataType>>& types,
- std::shared_ptr<MatchConstraint> constraint) {
+ const std::shared_ptr<MatchConstraint>& constraint) {
for (auto&& type : types) {
auto exec = GenerateTypeAgnosticPrimitive<CaseWhenFunctor>(*type);
AddCaseWhenKernel(scalar_function, type, std::move(exec), constraint);
@@ -2764,7 +2764,7 @@ void AddPrimitiveCaseWhenKernels(const std::shared_ptr<CaseWhenFunction>& scalar
void AddBinaryCaseWhenKernels(const std::shared_ptr<CaseWhenFunction>& scalar_function,
const std::vector<std::shared_ptr<DataType>>& types,
- std::shared_ptr<MatchConstraint> constraint) {
+ const std::shared_ptr<MatchConstraint>& constraint) {
for (auto&& type : types) {
auto exec = GenerateTypeAgnosticVarBinaryBase<CaseWhenFunctor>(*type);
AddCaseWhenKernel(scalar_function, type, std::move(exec), constraint);
@@ -2773,13 +2773,13 @@ void AddBinaryCaseWhenKernels(const std::shared_ptr<CaseWhenFunction>& scalar_fu
template <typename ArrowNestedType>
void AddNestedCaseWhenKernel(const std::shared_ptr<CaseWhenFunction>& scalar_function,
- std::shared_ptr<MatchConstraint> constraint) {
+ const std::shared_ptr<MatchConstraint>& constraint) {
AddCaseWhenKernel(scalar_function, ArrowNestedType::type_id,
CaseWhenFunctor<ArrowNestedType>::Exec, constraint);
}
void AddNestedCaseWhenKernels(const std::shared_ptr<CaseWhenFunction>& scalar_function,
- std::shared_ptr<MatchConstraint> constraint) {
+ const std::shared_ptr<MatchConstraint>& constraint) {
AddNestedCaseWhenKernel<FixedSizeListType>(scalar_function, constraint);
AddNestedCaseWhenKernel<ListType>(scalar_function, constraint);
AddNestedCaseWhenKernel<LargeListType>(scalar_function, constraint);