kosiew commented on code in PR #24587:
URL: https://github.com/apache/datafusion/pull/24587#discussion_r3868366601


##########
datafusion/physical-plan/src/joins/hash_join/stream.rs:
##########
@@ -559,11 +559,13 @@ impl HashJoinStream {
             .bounds
             .clone()
             .unwrap_or_else(|| PartitionBounds::new(vec![]));
-        // Arrow tracks null counts per array, so this costs no data scan.
+        // Use the logical null count: a dictionary key whose entry points at a
+        // NULL dictionary value is a NULL key even though the key bitmap has 
no
+        // physical nulls (`null_count() == 0` but `logical_null_count() > 0`).
         let keys_have_null = left_data
             .values()
             .iter()
-            .any(|array| array.null_count() > 0);
+            .any(|array| array.logical_null_count() > 0);

Review Comment:
   Could we add the same dictionary-value logical-NULL regression coverage for 
`PartitionMode::Partitioned`, using multiple partitions? `keys_have_null` is 
also aggregated by `build_partitioned_filter`, while the new test currently 
exercises only `CollectLeft`. Covering the partitioned case would help catch 
regressions in how the logical NULL state is aggregated or routed across 
partitions.



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