rymarm opened a new pull request, #2952: URL: https://github.com/apache/drill/pull/2952
# [DRILL-8513](https://issues.apache.org/jira/browse/DRILL-8513): Right Hash Join with empty Left table ruturns 0 result ## Description Drill returns no results on the right Hash Join if the probe(left) table is empty. The root cause is simple. Stack-trace of the point of failure: ``` changeToFinalProbeState:123, HashJoinProbeTemplate (org.apache.drill.exec.physical.impl.join) setup:105, ProbeTemplate (org.apache.drill.exec.physical.impl.join) <---- The issue comes from here. Because the changeToFinalProbeState() is called before all necessary variables are initialized by the HashJoinProbeTemplate#setup() method. setup:45, HashJoinProbeTemplate (org.apache.drill.exec.physical.impl.join) setupProbe:108, HashJoinBatch (org.apache.drill.exec.physical.impl.join) innerNext:585, AbstractHashBinaryRecordBatch (org.apache.drill.exec.physical.impl.join) ``` `HashJoinProbeTemplate#setup()` calls it's super `#setup()` before `joinType` set and it makes `#changeToFinalProbeState()` set incorrect `ProbeState`. This code change comes from https://github.com/apache/drill/pull/2599 The solution is as simple as the bug: to call `ProbeTemplate#setup(`) at the end of `HashJoinProbeTemplate#setup()`. ## Documentation \- ## Testing New unit test with an empty left input for HashJoin. -- 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: dev-unsubscr...@drill.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org