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_r245516644
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
 ##########
 @@ -224,6 +224,13 @@ private boolean isKeyMatch(int incomingRowIdx,
       if (isProbe) {
         match = isKeyMatchInternalProbe(incomingRowIdx, currentIdxWithinBatch);
       } else {
+        // in case (of a hash-join only) where both the new incoming key and 
the current are null, treat them as
+        // a match; i.e. the new would be added into the helper (but not the 
Hash-Table !), though it would never
+        // be used (not putting it into the helper would take a bigger code 
change, and some performance cost, hence
+        // not worth it).  In the past such a new null key was added into the 
Hash-Table (i.e., no match), which
+        // created long costly chains - SEE DRILL-6880)
+        if ( areBothKeysNull(incomingRowIdx, currentIdxWithinBatch) ) { return 
true; }
 
 Review comment:
   It would be better to update the 'match' state since subsequent code acts on 
it (line 230) even though currently it acts on 'False' (this will keep the 
logic consistent).  

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

Reply via email to