diff --git a/cpp/src/arrow/compute/kernels/vector_array_sort.cc b/cpp/src/arrow/compute/kernels/vector_array_sort.cc index 497ecd1ca96..bd11c3b3c3f 100644 --- a/cpp/src/arrow/compute/kernels/vector_array_sort.cc +++ b/cpp/src/arrow/compute/kernels/vector_array_sort.cc @@ -673,6 +673,7 @@ void RegisterVectorArraySort(FunctionRegistry* registry) { auto part_indices = std::make_shared( "partition_nth_indices", Arity::Unary(), partition_nth_indices_doc); base.init = PartitionNthToIndicesState::Init; + base.exec_chunked = nullptr; AddArraySortingKernels(base, part_indices.get()); DCHECK_OK(registry->AddFunction(std::move(part_indices))); } diff --git a/cpp/src/arrow/compute/kernels/vector_sort_test.cc b/cpp/src/arrow/compute/kernels/vector_sort_test.cc index 9bc30f23234..5b2f18748ff 100644 --- a/cpp/src/arrow/compute/kernels/vector_sort_test.cc +++ b/cpp/src/arrow/compute/kernels/vector_sort_test.cc @@ -293,6 +293,12 @@ TYPED_TEST(TestNthToIndicesForIntegral, Integral) { this->AssertNthToIndicesJson("[null, 1, 3, null, 2, 5]", 6); } +TYPED_TEST(TestNthToIndicesForIntegral, ChunkedArrayUnsupported) { + auto input = ChunkedArrayFromJSON(this->GetType(), {"[5, 4, 3]", "[2, 1, 0]"}); + PartitionNthOptions options(/*pivot=*/1); + ASSERT_RAISES(Invalid, CallFunction("partition_nth_indices", {input}, &options)); +} + TYPED_TEST(TestNthToIndicesForBool, Bool) { this->AssertNthToIndicesJson("[null, false, true, null, false, true]", 0); this->AssertNthToIndicesJson("[null, false, true, null, false, true]", 2);