Repository navigation
fix: [branch-1.2] hash NullType and ANSI interval values natively (#7084) - #7647
Merged
Merged
Conversation
* fix: hash NullType and ANSI interval values natively * test: cover NullType and ANSI interval hashing with SQL file tests Adds SQL file tests for the native paths this PR fixes: hash and xxhash64 with a NULL argument and with a NullType struct field, including under a null struct; reading a NullType field through a null struct with GetStructField and GetArrayStructFields; and native round-robin shuffle, with positional placement off, over a NULL column and both ANSI interval types. * test: hash lists of NullType and intervals; fold the NullType arm in struct_nulls Adds murmur3 and xxhash64 unit tests that hash a list of NullType, which must leave the hash unchanged, and lists of both ANSI interval types, which must hash like the same lists of ints and longs. Folds the NullType check in struct_nulls into the null-parent arm, and drops the unneeded localTableScan config from the round-robin SQL file test, noting why positional placement is pinned off. --------- Co-authored-by: ump45nose <ump45nose@users.noreply.github.com> (cherry picked from commit f1778b9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Backport of #7084 to
branch-1.2. Closes #7063 on this branch.Rationale for this change
The native Murmur3 and xxHash64 kernels have no arm for
Null,Interval(YearMonth)orDuration(Microsecond), sohash(a, null),xxhash64(a, null)and native round-robin shuffle over those types fail withUnsupported data type in hasher. Hashing a null struct that has aNullTypefield also panics (NullArray data should not contain a null buffer).branch-1.2has the same kernels. See #7084 and #7063 for the full analysis.What changes are included in this PR?
Cherry-pick of f1778b9 (
git cherry-pick -x) with no conflicts and no adaptations. It adds the missing arms tocreate_hashes_internal!, makeschild_with_parent_nullsreturn aNullchild unchanged, and includes the source PR's unit tests and SQL file tests. The diff against the source commit is identical apart from line numbers and blob hashes.Other release branches:
branch-1.2is the newest release branch, so there is no newer one to port to.How are these changes tested?
On this branch, with JDK 17 and the default Spark profile only: the 88
hash_funcstests indatafusion-comet-spark-exprand thestruct_nullstests indatafusion-comet-commonpass,cargo check --all-targetson both crates andcargo fmt --checkare clean, and./mvnw testranCometSqlFileTestSuiteforhash_null_type.sql,round_robin_null_and_intervals.sql,get_array_struct_fields.sqlandget_struct_field.sqlagainst a native library built from this branch (4 tests, 0 failures). With the native sources (native/common,native/spark-expr) restored tobranch-1.2's version, all four SQL file tests fail (Unsupported data type in hasher: Nulland theNullArraynull-buffer panic), so the branch has the bug and the tests catch it.