| 80 | } |
| 81 | |
| 82 | public void open() throws DbException, NoSuchElementException, |
| 83 | TransactionAbortedException { |
| 84 | // some code goes here |
| 85 | child1.open(); |
| 86 | child2.open(); |
| 87 | |
| 88 | while(child1.hasNext()){ |
| 89 | Tuple next1 = child1.next(); |
| 90 | while(child2.hasNext()){ |
| 91 | Tuple next2 = child2.next(); |
| 92 | if(joinPredicate.filter(next1,next2)){ |
| 93 | Tuple mergeTuple = new Tuple(tupleDesc); |
| 94 | Iterator<Field> fields1 = next1.fields(); |
| 95 | Iterator<Field> fields2 = next2.fields(); |
| 96 | int count = 0; |
| 97 | while(fields1.hasNext()){ |
| 98 | mergeTuple.setField(count++,fields1.next()); |
| 99 | } |
| 100 | while(fields2.hasNext()){ |
| 101 | mergeTuple.setField(count++,fields2.next()); |
| 102 | } |
| 103 | childTuple.add(mergeTuple); |
| 104 | } |
| 105 | } |
| 106 | child2.rewind(); |
| 107 | } |
| 108 | it = childTuple.iterator(); |
| 109 | super.open(); |
| 110 | } |
| 111 | |
| 112 | public void close() { |
| 113 | // some code goes here |