neilconway commented on code in PR #25774:
URL: https://github.com/apache/datafusion/pull/25774#discussion_r4115564906


##########
datafusion/sqllogictest/test_files/spark/hash/xxhash64.slt:
##########
@@ -195,3 +195,12 @@ SELECT id, xxhash64(id, name) FROM xxhash_test ORDER BY id;
 
 statement ok
 DROP TABLE xxhash_test;
+
+# A NULL struct hashes like any other NULL, whatever its fields still hold
+query BII
+SELECT s IS NULL,
+       xxhash64(s),
+       xxhash64(arrow_cast(NULL, 'Struct("a": Int64, "b": Utf8)'))
+FROM (SELECT nullif(s, s) AS s FROM (SELECT named_struct('a', 1, 'b', 'x') AS 
s));
+----
+true 42 42

Review Comment:
   I think this Claude suggestion is reasonable:
   ```
   P2: The tests can't tell "restore the incoming hash" from "reset to 42" 
(xxhash64.rs:427-452, xxhash64.slt:199-206)
   - Both tests put the struct in the first and only argument, where the 
incoming hash is always the seed.
   - I changed *hash = before[i] to *hash = 42: all 18 xxhash64 unit tests and 
xxhash64.slt still pass.
   - Suggest adding this SLT. It fails on base (-376592131717664991) and on the 
mutant (42):
   query II
   SELECT xxhash64(7, nullif(s, s)), xxhash64(7)
   FROM (SELECT named_struct('a', 1, 'b', 'x') AS s);
   ----
   -2864211556195259663 -2864211556195259663
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to