diff --git a/cpp/src/arrow/compute/kernels/vector_hash.cc b/cpp/src/arrow/compute/kernels/vector_hash.cc index f2d4c29f0ed..5121a8d4b46 100644 --- a/cpp/src/arrow/compute/kernels/vector_hash.cc +++ b/cpp/src/arrow/compute/kernels/vector_hash.cc @@ -719,7 +719,8 @@ void AddHashKernels(VectorFunction* func, VectorKernel base, OutputType out_ty) // Example parametric types that we want to match only on Type::type auto parametric_types = {time32(TimeUnit::SECOND), time64(TimeUnit::MICRO), - timestamp(TimeUnit::SECOND), fixed_size_binary(0)}; + timestamp(TimeUnit::SECOND), duration(TimeUnit::SECOND), + fixed_size_binary(0)}; for (const auto& ty : parametric_types) { base.init = GetHashInit(ty->id()); base.signature = KernelSignature::Make({ty->id()}, out_ty); diff --git a/cpp/src/arrow/compute/kernels/vector_hash_test.cc b/cpp/src/arrow/compute/kernels/vector_hash_test.cc index ec45239f9c6..7b713362f6f 100644 --- a/cpp/src/arrow/compute/kernels/vector_hash_test.cc +++ b/cpp/src/arrow/compute/kernels/vector_hash_test.cc @@ -315,6 +315,8 @@ TEST_F(TestHashKernel, UniqueTimeTimestamp) { CheckUnique(timestamp(TimeUnit::NANO), {2, 1, 2, 1}, {true, false, true, true}, {2, 0, 1}, {1, 0, 1}); + CheckUnique(duration(TimeUnit::NANO), {2, 1, 2, 1}, + {true, false, true, true}, {2, 0, 1}, {1, 0, 1}); } TEST_F(TestHashKernel, ValueCountsTimeTimestamp) { @@ -329,6 +331,9 @@ TEST_F(TestHashKernel, ValueCountsTimeTimestamp) { CheckValueCounts(timestamp(TimeUnit::NANO), {2, 1, 2, 1}, {true, false, true, true}, {2, 0, 1}, {1, 0, 1}, {2, 1, 1}); + CheckValueCounts(duration(TimeUnit::NANO), {2, 1, 2, 1}, + {true, false, true, true}, {2, 0, 1}, {1, 0, 1}, + {2, 1, 1}); } TEST_F(TestHashKernel, UniqueBoolean) {