Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a16a126
GH-17211: refresh history for scalar_hash kernel
drin Jan 12, 2024
9166f95
GH-17211: refresh history for updates to key_hash
drin Jan 12, 2024
45c886d
GH-17211: refresh history for new compute fn infra
drin Jan 12, 2024
ef6972e
GH-17211: refresh history of scalar hash benchmark
drin Jan 12, 2024
cc2ce1d
added KeyColumnArray alias
drin Oct 7, 2024
41c3a45
task: revert style and other minor changes
drin Oct 11, 2024
01aefa9
task: reducing support to some nested types
drin Oct 11, 2024
b3aa4cc
minor: added type check for ListArray
drin Oct 11, 2024
341049a
Update the implementation to use column oriented hash-combine.
kszucs Dec 10, 2024
8d3dd8b
add hypothesis test case and fix list hashing
kszucs Dec 11, 2024
4416860
ensure to keep newly allocated arrays alive until hash gets computed
kszucs Dec 11, 2024
e1feb5c
minor cleanup
kszucs Dec 11, 2024
cd5598e
wrong include
kszucs Dec 11, 2024
a94ee3a
add hash32 function
kszucs Dec 13, 2024
fc9f274
add hash32 function and address review comments
kszucs Dec 13, 2024
f796dfd
update testing suite
kszucs Dec 13, 2024
9048000
generated struct tests
kszucs Dec 13, 2024
f4f2b9b
prepare adding hash32 tests
kszucs Dec 13, 2024
b18d9da
add tests for hash32, dictionary encoded type, extension type
kszucs Dec 16, 2024
be78a25
ensure that NULL and 0 hashes to different numbers
kszucs Dec 16, 2024
08b13b8
fix the benchmarks
kszucs Dec 16, 2024
be72523
update docs to highlight 0 return for NULL values
kszucs Dec 16, 2024
111e8e2
use resize instead of reserve
kszucs Dec 17, 2024
46a8037
fix R compute function filtering test
kszucs Dec 17, 2024
505f45e
address review comments
kszucs Dec 18, 2024
435660f
update boolean test case
kszucs Dec 18, 2024
dcc5df6
update exec checks
kszucs Dec 18, 2024
2da4959
use Hasher::kHashBatchTempStackUsage
kszucs Dec 18, 2024
64c6c2f
ensure that slices properly work
kszucs Dec 18, 2024
b95224c
add tests for fixed_size_binary()
kszucs Dec 18, 2024
79330d8
add rudimentary quality tests
kszucs Dec 18, 2024
25cc9d6
test temporal types too
kszucs Dec 19, 2024
1a208df
test temporal and decimal types
kszucs Dec 19, 2024
c5d9eda
add type matcher to explicitly raise NotImplemented for unsupported t…
kszucs Dec 19, 2024
2db2074
update error message
kszucs Dec 19, 2024
f2bbe65
update docs
kszucs Dec 19, 2024
9871270
set a tolerance for the randomly generated numbers
kszucs Dec 19, 2024
3b6dcc3
make msvc happy
kszucs Dec 20, 2024
a06e32c
Rename DCHECK macros to ARROW_DCHECK
kszucs May 13, 2025
40acb83
Missing blank lines
kszucs May 14, 2025
b835eca
chore: move key_hash benchmarks to key_hash_benchmark.cc under compute
kszucs Jun 20, 2025
937edcb
Apply suggestions from code review
kszucs Jun 25, 2025
b54e655
use type singleton
kszucs Jun 25, 2025
1c87e11
run clang format on scalar_hash_benchmark.cc
kszucs Jun 25, 2025
afae612
run cmake format
kszucs Jun 25, 2025
a401669
Address review comments and fix missing-declarations build failure
kszucs Jul 23, 2026
9088d05
Fix unreachable slicing check and remove unused hashing_rng in benchm…
kszucs Jul 23, 2026
03da052
Fix nested-type null and hash-corruption bugs in hash32/hash64
kszucs Jul 23, 2026
e5ce276
Remove dead list-like branches from ToColumnArray
kszucs Jul 23, 2026
2ba2b0c
Fix independently-null nested fields hashing as non-zero garbage
kszucs Jul 23, 2026
65963a5
Size key_hash_benchmark's TempVectorStack from kHashBatchTempStackUsage
kszucs Jul 23, 2026
864d134
Hoist KeyColumnArray construction out of key_hash_benchmark's timed loop
kszucs Jul 23, 2026
0fe7475
Fix GCC -Werror=range-loop-construct in scalar_hash_test.cc
kszucs Jul 23, 2026
9d4571d
Guard against a null values buffer in ToColumnArray's binary path
kszucs Jul 23, 2026
3231405
Add R test asserting hash32/hash64 are discoverable via list_compute_…
kszucs Jul 23, 2026
ac9ef7b
Avoid hashing unreferenced child data for sliced list/map arrays, fix…
kszucs Jul 24, 2026
3aa8b77
Add hypothesis tests asserting hash32/hash64 respect Array.slice()
kszucs Jul 24, 2026
6c47007
Revert kAddend change to the shared HashIntImp; scope the null/0 fix …
kszucs Jul 24, 2026
07d0973
Unwrap extension types in HashableMatcher so unsupported storage type…
kszucs Jul 24, 2026
6053fa0
Add test coverage for zero/null collision across byte widths and FIXE…
kszucs Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ if(ARROW_COMPUTE)
compute/kernels/scalar_arithmetic.cc
compute/kernels/scalar_boolean.cc
compute/kernels/scalar_compare.cc
compute/kernels/scalar_hash.cc
compute/kernels/scalar_if_else.cc
compute/kernels/scalar_nested.cc
compute/kernels/scalar_random.cc
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ add_arrow_compute_test(row_test
arrow_compute_testing)

add_arrow_compute_benchmark(function_benchmark)
add_arrow_compute_benchmark(key_hash_benchmark)

add_subdirectory(kernels)

Expand Down
10 changes: 10 additions & 0 deletions cpp/src/arrow/compute/api_scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,16 @@ Result<Datum> MapLookup(const Datum& arg, MapLookupOptions options, ExecContext*
return CallFunction("map_lookup", {arg}, &options, ctx);
}

// ----------------------------------------------------------------------
// Hash functions
Result<Datum> Hash32(const Datum& input_array, ExecContext* ctx) {
return CallFunction("hash32", {input_array}, ctx);
}

Result<Datum> Hash64(const Datum& input_array, ExecContext* ctx) {
return CallFunction("hash64", {input_array}, ctx);
}

// ----------------------------------------------------------------------

} // namespace compute
Expand Down
37 changes: 37 additions & 0 deletions cpp/src/arrow/compute/api_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -1807,5 +1807,42 @@ ARROW_EXPORT Result<Datum> NanosecondsBetween(const Datum& left, const Datum& ri
/// \note API not yet finalized
ARROW_EXPORT Result<Datum> MapLookup(const Datum& map, MapLookupOptions options,
ExecContext* ctx = NULLPTR);

/// \brief Construct a hash value for each row of the input.
///
/// The result is an Array of length equal to the length of the input; however, the output
/// shall be a UInt32Array, with each element being a hash constructed from each row of
/// the input. If the input Array is a NestedArray, this means that each "attribute" or
/// "field" of the input NestedArray corresponding to the same "row" will collectively
/// produce a single uint32_t hash. At the moment, this function does not take options,
/// though these may be added in the future.
///
/// \param[in] input_array input data to hash
/// \param[in] ctx function execution context, optional
/// \return elementwise hash values
///
/// \since 26.0.0
/// \note API not yet finalized
ARROW_EXPORT
Result<Datum> Hash32(const Datum& input_array, ExecContext* ctx = NULLPTR);

/// \brief Construct a hash value for each row of the input.
///
/// The result is an Array of length equal to the length of the input; however, the output
/// shall be a UInt64Array, with each element being a hash constructed from each row of
/// the input. If the input Array is a NestedArray, this means that each "attribute" or
/// "field" of the input NestedArray corresponding to the same "row" will collectively
/// produce a single uint64_t hash. At the moment, this function does not take options,
/// though these may be added in the future.
///
/// \param[in] input_array input data to hash
/// \param[in] ctx function execution context, optional
/// \return elementwise hash values
///
/// \since 26.0.0
/// \note API not yet finalized
ARROW_EXPORT
Result<Datum> Hash64(const Datum& input_array, ExecContext* ctx = NULLPTR);

} // namespace compute
} // namespace arrow
1 change: 1 addition & 0 deletions cpp/src/arrow/compute/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Status RegisterComputeKernels() {
internal::RegisterScalarArithmetic(registry);
internal::RegisterScalarBoolean(registry);
internal::RegisterScalarComparison(registry);
internal::RegisterScalarHash(registry);
internal::RegisterScalarIfElse(registry);
internal::RegisterScalarNested(registry);
internal::RegisterScalarRandom(registry); // Nullary
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/compute/kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ add_arrow_compute_test(scalar_math_test

add_arrow_compute_test(scalar_utility_test
SOURCES
scalar_hash_test.cc
scalar_random_test.cc
scalar_set_lookup_test.cc
scalar_validity_test.cc
Expand All @@ -89,6 +90,7 @@ add_arrow_benchmark(scalar_cast_benchmark PREFIX "arrow-compute")
add_arrow_compute_benchmark(scalar_arithmetic_benchmark)
add_arrow_compute_benchmark(scalar_boolean_benchmark)
add_arrow_compute_benchmark(scalar_compare_benchmark)
add_arrow_compute_benchmark(scalar_hash_benchmark)
add_arrow_compute_benchmark(scalar_if_else_benchmark)
add_arrow_compute_benchmark(scalar_list_benchmark)
add_arrow_compute_benchmark(scalar_random_benchmark)
Expand Down
Loading
Loading