The expression must be specified in terms of the input fields. If not, call {@link #registerOutput(RexNode)} first.
357358359360361362363364365366367
{ // Build a program that has a condition (a possibly complex expression) // but projects all inputs. final RexProgramBuilder builder = new RexProgramBuilder( previous.getOutputRowType(), rexBuilder ); builder.addIdentity(); builder.addCondition( program.gatherExpr( program.getCondition() ) ); previous = builder.getProgram(); list.add( Pair.of( Op.FILTER, previous ) ); // Remove condition from the remaining program. final RexProgramBuilder builder2 = RexProgramBuilder.forProgram( program, rexBuilder, false );