From 2ff678915b0709594cf021924af5917290598393 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Sat, 15 Jun 2024 12:04:46 -0300 Subject: [PATCH] Take: Simplify TakeMetaFunction even further --- .../compute/kernels/vector_selection_take_internal.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cpp/src/arrow/compute/kernels/vector_selection_take_internal.cc b/cpp/src/arrow/compute/kernels/vector_selection_take_internal.cc index fefb299fa1f00..c853b4c2ecb0b 100644 --- a/cpp/src/arrow/compute/kernels/vector_selection_take_internal.cc +++ b/cpp/src/arrow/compute/kernels/vector_selection_take_internal.cc @@ -830,15 +830,9 @@ class TakeMetaFunction : public MetaFunction { const auto& take_opts = static_cast(*options); switch (args[0].kind()) { case Datum::ARRAY: - // "array_take" can handle AA->A and AC->C cases directly - // (via their VectorKernel::exec and VectorKernel::exec_chunked) - if (index_kind == Datum::ARRAY || index_kind == Datum::CHUNKED_ARRAY) { - return CallArrayTake(args, take_opts, ctx); - } - break; case Datum::CHUNKED_ARRAY: - // "array_take" can handle CA->C and CC->C cases directly - // (via their VectorKernel::exec_chunked) + // "array_take" can handle AA->A, AC->C, CA->C, CC->C cases directly + // (via their VectorKernel::exec and VectorKernel::exec_chunked) if (index_kind == Datum::ARRAY || index_kind == Datum::CHUNKED_ARRAY) { return CallArrayTake(args, take_opts, ctx); }