public static Analyzed analyze( RexProgram program ) { return new Analyzed( program, hasFunctions( program ), hasConstants( program ), isComplex( program ), isOnlyRename( program ), program.getPermutation() ); }
private static Pipe addRename( RelOptCluster cluster, RexProgram program, Pipe pipe ) { // We know that the input has unique field names, and the output has unique // field names. if( !unique( program.getInputRowType().getFieldNames() ) ) throw new AssertionError(); if( !unique( program.getOutputRowType().getFieldNames() ) ) throw new AssertionError(); final Permutation permutation = program.getPermutation(); if( permutation == null ) throw new AssertionError(); Fields incomingFields = createTypedFields( cluster, Mappings.apply( permutation.inverse(), program.getInputRowType().getFieldList() ), false ); Fields renameFields = createTypedFieldsSelector( cluster, program.getOutputRowType(), false ); return new Rename( pipe, incomingFields, renameFields ); }
Permutation permutation1 = calcRel.getProgram().getPermutation(); if (permutation1 != null) { Permutation permutation2 = permutation.product(permutation1);
Permutation permutation1 = calcRel.getProgram().getPermutation(); if (permutation1 != null) { Permutation permutation2 = permutation.product(permutation1);