protected void build() { clearGroups(); if( collections[ 0 ] instanceof FalseCollection ) // force reset on FalseCollection ( (FalseCollection) collections[ 0 ] ).reset( null ); while( values[ 0 ].hasNext() ) { IndexTuple current = (IndexTuple) values[ 0 ].next(); int pos = current.getIndex(); // if this is the first (lhs) co-group, just use values iterator // we are guaranteed all the remainder tuples in the iterator are from pos == 0 if( numSelfJoins == 0 && pos == 0 ) { ( (FalseCollection) collections[ 0 ] ).reset( createIterator( current, values[ 0 ] ) ); break; } collections[ pos ].add( current.getTuple() ); // get the value tuple for this cogroup } }
protected void initLists() { collections = new Collection[ size() ]; // handle self joins if( numSelfJoins != 0 ) { Arrays.fill( collections, createTupleCollection( joinFields[ 0 ] ) ); } else { collections[ 0 ] = new FalseCollection(); // we iterate this only once per grouping for( int i = 1; i < joinFields.length; i++ ) collections[ i ] = createTupleCollection( joinFields[ i ] ); } joinedBuilder = makeJoinedBuilder( joinFields ); joinedTuplesArray = new Tuple[ collections.length ]; }
protected void initLists() { collections = new Collection[ size() ]; // handle self joins if( numSelfJoins != 0 ) { Arrays.fill( collections, createTupleCollection( joinFields[ 0 ] ) ); } else { collections[ 0 ] = new FalseCollection(); // we iterate this only once per grouping for( int i = 1; i < joinFields.length; i++ ) collections[ i ] = createTupleCollection( joinFields[ i ] ); } joinedBuilder = makeJoinedBuilder( joinFields ); joinedTuplesArray = new Tuple[ collections.length ]; }
protected void build() { clearGroups(); if( collections[ 0 ] instanceof FalseCollection ) // force reset on FalseCollection ( (FalseCollection) collections[ 0 ] ).reset( null ); while( values[ 0 ].hasNext() ) { IndexTuple current = (IndexTuple) values[ 0 ].next(); int pos = current.getIndex(); // if this is the first (lhs) co-group, just use values iterator // we are guaranteed all the remainder tuples in the iterator are from pos == 0 if( numSelfJoins == 0 && pos == 0 ) { ( (FalseCollection) collections[ 0 ] ).reset( createIterator( current, values[ 0 ] ) ); break; } collections[ pos ].add( current.getTuple() ); // get the value tuple for this cogroup } }