Commit 6b134dd
authored
feat: add Spark-compatible xxhash64 function (#21967)
## Which issue does this PR close?
- Partially addresses #14044
## Rationale for this change
Donate the `xxhash64` hash function from Comet so that other projects
can benefit from it.
The function was initially implemented in Comet by @advancedxy.
This is a continuation of #19627, which has gone stale. To keep the
change focused
and easier to review, this PR adds only `xxhash64`. Murmur3 will follow
in a separate PR.
The first commit is the same as the version of #19627 that was
previously approved.
The second commit implements optmizations and bug fixes from the latest
Comet version.
The third commit is cleanup.
## What changes are included in this PR?
- Add `xxhash64(expr1, expr2, ...)` to `datafusion-spark`.
- Add Rust unit tests for primitives, boundary values, emoji/CJK
strings, float `-0.0`
normalization, dictionaries (with and without nulls), `FixedSizeBinary`,
`Struct`, and
`List`.
- Add sqllogictest coverage in
`datafusion/sqllogictest/test_files/spark/hash/xxhash64.slt`
with values verified against Spark.
## Are these changes tested?
Yes, both Rust unit tests and sqllogictest are included.
## Are there any user-facing changes?
A new `xxhash64` scalar function is available in `datafusion-spark`.1 parent e1dc63e commit 6b134dd
6 files changed
Lines changed: 1658 additions & 2 deletions
File tree
- datafusion
- spark
- src/function/hash
- sqllogictest/test_files/spark/hash
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | | - | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | | - | |
| 44 | + | |
41 | 45 | | |
0 commit comments