src/logicalPlan/source/LogicalPlanBuilder.cc
shared_ptr<ApplyLambda> makeApplyLambdaFromApplyBase(const ApplyBase& apply) {
    /*
     * Create an "input" TupleSpec that corresponds to ApplyBase.inputColumns;
     *
     * For example, if the original TCAP assignment was:
     *
     *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student,
     * teacher
     *
     * input would be:
     *
     *    setName: "A"
     *    atts: ["student", "class"]
     */
    TupleSpec input;
    {
        AttList attributes = makeAttributeList(apply.inputColumns);
        string inputTable = apply.inputColumns.tableName;
        input = TupleSpec(inputTable, attributes);
    }

    /*
     * Create an "output" TupleSpec that corresponds to the result of the apply operation
     *
     * For example, if the original TCAP assignment was:
     *
     *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student,
     * teacher
     *
     * output would be:
     *
     *    setName: "B"
     *    atts: ["student", "teacher", "fooResult"]
     */
    TupleSpec output;
    {
        AttList attributes = makeAttributeList(*apply.columnsToCopyToOutputTable.get());
        attributes.appendAttribute(apply.outputColumnId);
        output = TupleSpec(apply.outputTableId, attributes);
    }

    /*
     * Create a "projection" TupleSpec that describes which columns are to be copied from the input
     * to the output.
     * (these will be a subset of the output TupleSpec created above)
     *
     * For example, if the original TCAP assignment was:
     *
     *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student,
     * teacher
     *
     * output would be:
     *
     *    setName: "A"
     *    atts: ["student", "teacher"]
     *
     */
    TupleSpec projection;
    {
        AttList attributes = makeAttributeList(*apply.columnsToCopyToOutputTable.get());
        projection = TupleSpec(apply.inputColumns.tableName, attributes);
    }

    return make_shared<ApplyLambda>(input, output, projection, apply.executorId);
}
/**
 * Creates a corresponding ApplyLambda from the given ApplyBase.
 *
 * For example, if the given ApplyBase modeled the following TCAP statement:
 *
 *     @exec "executor1"
 *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student, teacher
 *
 * The translated ApplLambda woud be constructed with the following parameters:
 *
 * input:        ("A", ["student", "class"])
 * output:       ("B", ["student", "teacher", "fooResult"])
 * projection:   ("A", ["student", "teacher"])
 * lambdaNameIn: "executor1"
 *
 * @param apply the ApplyBase to translate
 * @return an ApplyLambda that corresponds to apply.
 */
Creates a corresponding ApplyLambda from the given ApplyBase.
For example, if the given ApplyBase modeled the following TCAP statement.

@exec "executor1"
B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student, teacher

The translated ApplLambda woud be constructed with the following parameters.



@param apply the ApplyBase to translate
@return an ApplyLambda that corresponds to apply.
Creates a corresponding ApplyLambda from the given ApplyBase . For example if the given ApplyBase modeled the following TCAP statement . @exec " executor1 " B ( student teacher fooResult ) = apply func " foo " to A [ student class ] retain student teacher The translated ApplLambda woud be constructed with the following parameters . @param apply the ApplyBase to translate @return an ApplyLambda that corresponds to apply .
shared_ptr<ApplyLambda> makeApplyLambdaFromApplyBase(const ApplyBase& apply) {
    TupleSpec input;
    {
        AttList attributes = makeAttributeList(apply.inputColumns);
        string inputTable = apply.inputColumns.tableName;
        input = TupleSpec(inputTable, attributes);
    }
    TupleSpec output;
    {
        AttList attributes = makeAttributeList(*apply.columnsToCopyToOutputTable.get());
        attributes.appendAttribute(apply.outputColumnId);
        output = TupleSpec(apply.outputTableId, attributes);
    }
    TupleSpec projection;
    {
        AttList attributes = makeAttributeList(*apply.columnsToCopyToOutputTable.get());
        projection = TupleSpec(apply.inputColumns.tableName, attributes);
    }
    return make_shared<ApplyLambda>(input, output, projection, apply.executorId);
}
shared_ptr < ApplyLambda > makeApplyLambdaFromApplyBase ( const ApplyBase & apply ) { TupleSpec input ; { AttList attributes = makeAttributeList ( apply . inputColumns ) ; string inputTable = apply . inputColumns . tableName ; input = TupleSpec ( inputTable , attributes ) ; } TupleSpec output ; { AttList attributes = makeAttributeList ( * apply . columnsToCopyToOutputTable . get ( ) ) ; attributes . appendAttribute ( apply . outputColumnId ) ; output = TupleSpec ( apply . outputTableId , attributes ) ; } TupleSpec projection ; { AttList attributes = makeAttributeList ( * apply . columnsToCopyToOutputTable . get ( ) ) ; projection = TupleSpec ( apply . inputColumns . tableName , attributes ) ; } return make_shared < ApplyLambda > ( input , output , projection , apply . executorId ) ; }
Creates a corresponding ApplyLambda from the given ApplyBase.
Creates a corresponding ApplyLambda from the given ApplyBase .
/*
     * Create an "input" TupleSpec that corresponds to ApplyBase.inputColumns;
     *
     * For example, if the original TCAP assignment was:
     *
     *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student,
     * teacher
     *
     * input would be:
     *
     *    setName: "A"
     *    atts: ["student", "class"]
     */ /*
     * Create an "output" TupleSpec that corresponds to the result of the apply operation
     *
     * For example, if the original TCAP assignment was:
     *
     *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student,
     * teacher
     *
     * output would be:
     *
     *    setName: "B"
     *    atts: ["student", "teacher", "fooResult"]
     */ /*
     * Create a "projection" TupleSpec that describes which columns are to be copied from the input
     * to the output.
     * (these will be a subset of the output TupleSpec created above)
     *
     * For example, if the original TCAP assignment was:
     *
     *     B(student, teacher, fooResult) = apply func "foo" to A[student,class] retain student,
     * teacher
     *
     * output would be:
     *
     *    setName: "A"
     *    atts: ["student", "teacher"]
     *
     */