Pipe pipeUpper1 = new Each( "upper1", new Fields( "line" ), function );
Pipe pipeUpper2 = new Each( "upper2", new Fields( "line" ), function );
Pipe splice1 = new CoGroup( pipeLower, new Fields( "num" ), pipeUpper1, new Fields( "num" ), new Fields( "num1", "char1", "num2", "char2" ) );
splice1 = new Each( splice1, new Identity() );
splice1 = new Each( splice1, new Identity() );
splice1 = new Each( new Pipe( "last", splice1 ), new Identity() );
splice1 = new GroupBy( splice1, new Fields( 0 ) );
Pipe splice2 = new CoGroup( splice1, new Fields( "num1" ), pipeUpper2, new Fields( "num" ), new Fields( "num1", "char1", "num2", "char2", "num3", "char3" ) );
if( testBetween )
splice2 = new Each( new Pipe( "before", splice2 ), new Identity() );
splice2 = new Each( new Pipe( "remove", splice2 ), new Identity() );
if( testBetween )
splice2 = new Each( new Pipe( "after", splice2 ), new Identity() );
splice2 = new GroupBy( splice2, new Fields( 0 ) );
Pipe tail = new CoGroup( splice2, new Fields( "num1" ), splice1, new Fields( "num1" ), new Fields( "num1", "char1", "num2", "char2", "num3", "char3", "num4", "char4", "num5", "char5" ) );
tail = new Each( tail, new Identity() );
Pipe lhsTail = new Pipe( "lhsTail", tail );
lhsTail = new Each( lhsTail, new Identity() );
Pipe rhsTail = new Pipe( "rhsTail", tail );
rhsTail = new Each( rhsTail, new Identity() );
Map<String, Tap> sources = createHashMap();
sources.put( "lower", new NonTap( new Fields( "offset", "line" ) ) );
sources.put( "upper1", new NonTap( new Fields( "offset", "line" ) ) );