src/logicalPlan/source/LogicalPlanBuilder.cc
shared_ptr<ApplyLambda> makeApplyLambdaFromHoist(const Hoist& hoist) {
    /*
     * Create an "input" TupleSpec that corresponds to hoist.inputColumn;
     *
     * For example, if the original TCAP assignment was:
     *
     *     C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain
     * student, examAverage
     *
     * input would be:
     *
     *    setName: "B"
     *    atts: ["student"]
     */
    TupleSpec input;
    {
        AttList inputColumn;
        inputColumn.appendAttribute(hoist.inputColumn.columnId);
        input = TupleSpec(hoist.inputColumn.tableId, inputColumn);
    }

    /*
     * Create an "output" TupleSpec that corresponds the result of the operation.
     *
     * For example, if the original TCAP assignment was:
     *
     *     C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain
     * student, examAverage
     *
     * output would be:
     *
     *    setName: "C"
     *    atts: ["student", "examAverage", "hwAverage"]
     */
    TupleSpec output;
    {
        AttList attributes = makeAttributeList(*hoist.columnsToCopyToOutputTable.get());
        attributes.appendAttribute(hoist.outputColumn.columnId);
        output = TupleSpec(hoist.outputColumn.tableId, 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:
     *
     *     C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain
     * student, examAverage
     *
     * output would be:
     *
     *    setName: "B"
     *    atts: ["student", "examAverage"]
     *
     */
    TupleSpec projection;
    {
        AttList attributes = makeAttributeList(*hoist.columnsToCopyToOutputTable.get());
        projection = TupleSpec(hoist.inputColumn.tableId, attributes);
    }

    return make_shared<ApplyLambda>(input, output, projection, hoist.executorId);
}
/**
 * Creates a corresponding ApplyLambda from the given Hoist:
 *
 * For example, if the given Hoist modeled the following TCAP statement:
 *
 *    @exec "executor2"
 *    C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain student,
 * examAverage
 *
 * the created ApplyLambda would have the following form:
 *
 * input:      ("B", ["student"])
 * output:     ("C", ["student", "examAverage", "hwAverage"])
 * projection: ("B", ["student", "examAverage"])
 * lambdaName: "executor2"
 *
 * @param hoist the Hoist to translate into an ApplyLambda
 * @return an ApplyLambda translation of host
 */
Creates a corresponding ApplyLambda from the given Hoist:
For example, if the given Hoist modeled the following TCAP statement.

@exec "executor2"
C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain student,
examAverage

the created ApplyLambda would have the following form.



@param hoist the Hoist to translate into an ApplyLambda
@return an ApplyLambda translation of host
Creates a corresponding ApplyLambda from the given Hoist : For example if the given Hoist modeled the following TCAP statement . @exec " executor2 " C ( student examAverage hwAverage ) = hoist " homeworkAverage " from B [ student ] retain student examAverage the created ApplyLambda would have the following form . @param hoist the Hoist to translate into an ApplyLambda @return an ApplyLambda translation of host
shared_ptr<ApplyLambda> makeApplyLambdaFromHoist(const Hoist& hoist) {
    TupleSpec input;
    {
        AttList inputColumn;
        inputColumn.appendAttribute(hoist.inputColumn.columnId);
        input = TupleSpec(hoist.inputColumn.tableId, inputColumn);
    }
    TupleSpec output;
    {
        AttList attributes = makeAttributeList(*hoist.columnsToCopyToOutputTable.get());
        attributes.appendAttribute(hoist.outputColumn.columnId);
        output = TupleSpec(hoist.outputColumn.tableId, attributes);
    }
    TupleSpec projection;
    {
        AttList attributes = makeAttributeList(*hoist.columnsToCopyToOutputTable.get());
        projection = TupleSpec(hoist.inputColumn.tableId, attributes);
    }
    return make_shared<ApplyLambda>(input, output, projection, hoist.executorId);
}
shared_ptr < ApplyLambda > makeApplyLambdaFromHoist ( const Hoist & hoist ) { TupleSpec input ; { AttList inputColumn ; inputColumn . appendAttribute ( hoist . inputColumn . columnId ) ; input = TupleSpec ( hoist . inputColumn . tableId , inputColumn ) ; } TupleSpec output ; { AttList attributes = makeAttributeList ( * hoist . columnsToCopyToOutputTable . get ( ) ) ; attributes . appendAttribute ( hoist . outputColumn . columnId ) ; output = TupleSpec ( hoist . outputColumn . tableId , attributes ) ; } TupleSpec projection ; { AttList attributes = makeAttributeList ( * hoist . columnsToCopyToOutputTable . get ( ) ) ; projection = TupleSpec ( hoist . inputColumn . tableId , attributes ) ; } return make_shared < ApplyLambda > ( input , output , projection , hoist . executorId ) ; }
Creates a corresponding ApplyLambda from the given Hoist:
 For example, if the given Hoist modeled the following TCAP statement:
Creates a corresponding ApplyLambda from the given Hoist : For example if the given Hoist modeled the following TCAP statement :
/*
     * Create an "input" TupleSpec that corresponds to hoist.inputColumn;
     *
     * For example, if the original TCAP assignment was:
     *
     *     C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain
     * student, examAverage
     *
     * input would be:
     *
     *    setName: "B"
     *    atts: ["student"]
     */ /*
     * Create an "output" TupleSpec that corresponds the result of the operation.
     *
     * For example, if the original TCAP assignment was:
     *
     *     C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain
     * student, examAverage
     *
     * output would be:
     *
     *    setName: "C"
     *    atts: ["student", "examAverage", "hwAverage"]
     */ /*
     * 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:
     *
     *     C(student, examAverage, hwAverage) = hoist "homeworkAverage" from B[student] retain
     * student, examAverage
     *
     * output would be:
     *
     *    setName: "B"
     *    atts: ["student", "examAverage"]
     *
     */