public static QueryIterator joinWorker(QueryIterator left, Table right, JoinType joinType, ExprList conditions, ExecutionContext execCxt) { if ( right.isEmpty() ) { if ( joinType == INNER ) { // No rows - no match left.close() ; return QueryIterNullIterator.create(execCxt) ; } else // Left join - pass out left rows regardless of conditions. return left ; } if ( TableUnit.isTableUnit(right) ) return applyConditions(left, conditions, execCxt) ; return joinWorkerN(left, right, joinType, conditions, execCxt) ; }