adriangb commented on code in PR #18449:
URL: https://github.com/apache/datafusion/pull/18449#discussion_r2484955815


##########
datafusion/physical-expr/src/expressions/in_list.rs:
##########
@@ -443,12 +560,33 @@ impl Hash for InListExpr {
     fn hash<H: Hasher>(&self, state: &mut H) {
         self.expr.hash(state);
         self.negated.hash(state);
-        self.list.hash(state);
-        // Add `self.static_filter` when hash is available
+        match &self.list {
+            InListStorage::Array { array, .. } => {
+                let random_state = RandomState::with_seed(0);
+                let mut hashes_buf = vec![0u64; array.len()];
+                let Ok(hashes_buf) = create_hashes_from_arrays(
+                    &[array.as_ref()],
+                    &random_state,
+                    &mut hashes_buf,
+                ) else {
+                    unreachable!("Failed to create hashes for InList array. 
This shouldn't happen because make_set should have succeeded earlier.");
+                };
+                hashes_buf.hash(state);

Review Comment:
   We could pre-compute and store a `hash: u64` which would be both more 
performant when `Hash` is called and avoid this error, but it would add more 
complexity and some overhead when building the `InListExpr`



-- 
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