MassivePizza commented on code in PR #24105:
URL: https://github.com/apache/datafusion/pull/24105#discussion_r3990769005


##########
datafusion/physical-plan/src/aggregates/topk/hash_table.rs:
##########
@@ -482,9 +498,7 @@ impl<ID: KeyType + PartialEq> TopKHashTable<ID> {
             .iter()
             .enumerate()
             .filter_map(|(idx, item)| {
-                item.as_ref()
-                    .filter(|item| item.heap_idx == NULL_HEAP_IDX)
-                    .map(|_| idx)
+                (item.id.is_some() && item.is_null()).then_some(idx)

Review Comment:
   So that fixed `null_map_idxs` easily, but I imagine we are still not correct 
because callers of TopKHashTable can still mangle null state...



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