@Override public Tuple next() throws SQLException { if (!initialized) { init(); while (next == null && !isEnd()) { if (queueIterator != null) { if (queueIterator.hasNext()) { next = join(lhsTuple, queueIterator.next()); } else { boolean eq = nextLhsTuple != null && lhsKey.equals(nextLhsKey); advance(true); if (eq) { queueIterator = queue.iterator(); if (rhsTuple != null) { if (lhsKey.equals(rhsKey)) { next = join(lhsTuple, rhsTuple); if (nextLhsTuple != null && lhsKey.equals(nextLhsKey)) { queue.offer(rhsTuple); if (nextRhsTuple == null || !rhsKey.equals(nextRhsKey)) { queueIterator = queue.iterator(); advance(true); } else if (isSingleValueOnly) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SINGLE_ROW_SUBQUERY_RETURNS_MULTIPLE_ROWS).build().buildException(); advance(true); } else if (isSingleValueOnly) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SINGLE_ROW_SUBQUERY_RETURNS_MULTIPLE_ROWS).build().buildException();
@Override public Tuple next() throws SQLException { if (!initialized) { init(); while (next == null && !isEnd()) { if (queueIterator != null) { if (queueIterator.hasNext()) { next = join(lhsTuple, queueIterator.next()); } else { boolean eq = nextLhsTuple != null && lhsKey.equals(nextLhsKey); advance(true); if (eq) { queueIterator = queue.iterator(); if (rhsTuple != null) { if (lhsKey.equals(rhsKey)) { next = join(lhsTuple, rhsTuple); if (nextLhsTuple != null && lhsKey.equals(nextLhsKey)) { queue.offer(rhsTuple); if (nextRhsTuple == null || !rhsKey.equals(nextRhsKey)) { queueIterator = queue.iterator(); advance(true); } else if (isSingleValueOnly) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SINGLE_ROW_SUBQUERY_RETURNS_MULTIPLE_ROWS).build().buildException(); advance(true); } else if (isSingleValueOnly) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SINGLE_ROW_SUBQUERY_RETURNS_MULTIPLE_ROWS).build().buildException();
@Override public Tuple next() throws SQLException { if (!initialized) { init(); while (next == null && !isEnd()) { if (queueIterator != null) { if (queueIterator.hasNext()) { next = join(lhsTuple, queueIterator.next()); } else { boolean eq = nextLhsTuple != null && lhsKey.equals(nextLhsKey); advance(true); if (eq) { queueIterator = queue.iterator(); if (rhsTuple != null) { if (lhsKey.equals(rhsKey)) { next = join(lhsTuple, rhsTuple); if (nextLhsTuple != null && lhsKey.equals(nextLhsKey)) { queue.offer(rhsTuple); if (nextRhsTuple == null || !rhsKey.equals(nextRhsKey)) { queueIterator = queue.iterator(); advance(true); } else if (isSingleValueOnly) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SINGLE_ROW_SUBQUERY_RETURNS_MULTIPLE_ROWS).build().buildException(); advance(true); } else if (isSingleValueOnly) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.SINGLE_ROW_SUBQUERY_RETURNS_MULTIPLE_ROWS).build().buildException();
@Override public ResultIterator iterator(ParallelScanGrouper scanGrouper, Scan scan) throws SQLException { return type == JoinType.Semi || type == JoinType.Anti ? new SemiAntiJoinIterator(lhsPlan.iterator(scanGrouper), rhsPlan.iterator(scanGrouper)) : new BasicJoinIterator(lhsPlan.iterator(scanGrouper), rhsPlan.iterator(scanGrouper)); }
@Override public ResultIterator iterator(ParallelScanGrouper scanGrouper, Scan scan) throws SQLException { return type == JoinType.Semi || type == JoinType.Anti ? new SemiAntiJoinIterator(lhsPlan.iterator(scanGrouper), rhsPlan.iterator(scanGrouper)) : new BasicJoinIterator(lhsPlan.iterator(scanGrouper), rhsPlan.iterator(scanGrouper)); }
@Override public ResultIterator iterator(ParallelScanGrouper scanGrouper, Scan scan) throws SQLException { return type == JoinType.Semi || type == JoinType.Anti ? new SemiAntiJoinIterator(lhsPlan.iterator(scanGrouper), rhsPlan.iterator(scanGrouper)) : new BasicJoinIterator(lhsPlan.iterator(scanGrouper), rhsPlan.iterator(scanGrouper)); }