private void advance(boolean lhs) throws SQLException {
   if (lhs) {
     lhsTuple = nextLhsTuple;
     lhsKey.set(nextLhsKey);
     if (lhsTuple != null) {
       nextLhsTuple = lhsIterator.next();
       if (nextLhsTuple != null) {
         nextLhsKey.evaluate(nextLhsTuple);
       } else {
         nextLhsKey.clear();
       }
     }
   } else {
     rhsTuple = nextRhsTuple;
     rhsKey.set(nextRhsKey);
     if (rhsTuple != null) {
       nextRhsTuple = rhsIterator.next();
       if (nextRhsTuple != null) {
         nextRhsKey.evaluate(nextRhsTuple);
       } else {
         nextRhsKey.clear();
       }
     }
   }
 }
 private void init() throws SQLException {
   nextLhsTuple = lhsIterator.next();
   if (nextLhsTuple != null) {
     nextLhsKey.evaluate(nextLhsTuple);
   }
   advance(true);
   nextRhsTuple = rhsIterator.next();
   if (nextRhsTuple != null) {
     nextRhsKey.evaluate(nextRhsTuple);
   }
   advance(false);
   initialized = true;
 }