amansinha100 commented on a change in pull request #1598: DRILL-6880: For
Hash-Join hash-table build - treat null keys as an equal match
URL: https://github.com/apache/drill/pull/1598#discussion_r246220240
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
##########
@@ -661,16 +669,15 @@ public PutStatus put(int incomingRowIdx, IndexPointer
htIdxHolder, int hashCode,
// if startIdx is non-empty, follow the hash chain links until we find a
matching
// key or reach the end of the chain (and remember the last link there)
- for ( currentIdxHolder.value = startIdx;
- currentIdxHolder.value != EMPTY_SLOT;
- /* isKeyMatch() below also advances the currentIdxHolder to the next
link */) {
-
+ for ( int currentIndex = startIdx;
+ currentIndex != EMPTY_SLOT;
+ currentIndex = lastEntryBatch.nextLinkInHashChain(currentIndex)) {
Review comment:
Presumably this function call gets inlined by the JVM ? Since it gets
called for every Put operation, this is a performance critical code. Also, the
comment in the method says 'this method should only be called following a False
from isKeyMatch()'. It would have been better to call this in the 'else'
portion after the 'if' check on line 679 even though the loop condition is
being checked after a False is returned (but it is not intuitive).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services