Dandandan commented on code in PR #16153: URL: https://github.com/apache/datafusion/pull/16153#discussion_r2105352095
########## datafusion/physical-plan/src/joins/join_hash_map.rs: ########## @@ -261,13 +264,32 @@ pub trait JoinHashMapType { limit: usize, offset: JoinHashMapOffset, ) -> (Vec<u32>, Vec<u64>, Option<JoinHashMapOffset>) { - let mut input_indices = vec![]; - let mut match_indices = vec![]; - - let mut remaining_output = limit; + let mut input_indices = Vec::with_capacity(limit); + let mut match_indices = Vec::with_capacity(limit); let hash_map: &HashTable<(u64, u64)> = self.get_map(); let next_chain = self.get_list(); + // Check if hashmap consists of unique values + // If so, we can skip the chain traversal + if self.is_distinct() { Review Comment: `deleted_offset` wasn't used anymore - I removed it. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org