Search in sources :

Example 1 with NestedLoopJoinCodeGenerator

use of org.apache.flink.table.planner.codegen.NestedLoopJoinCodeGenerator in project flink by apache.

the class BatchExecNestedLoopJoin method translateToPlanInternal.

@Override
@SuppressWarnings("unchecked")
protected Transformation<RowData> translateToPlanInternal(PlannerBase planner, ExecNodeConfig config) {
    ExecEdge leftInputEdge = getInputEdges().get(0);
    ExecEdge rightInputEdge = getInputEdges().get(1);
    Transformation<RowData> leftInputTransform = (Transformation<RowData>) leftInputEdge.translateToPlan(planner);
    Transformation<RowData> rightInputTransform = (Transformation<RowData>) rightInputEdge.translateToPlan(planner);
    // get input types
    RowType leftType = (RowType) leftInputEdge.getOutputType();
    RowType rightType = (RowType) rightInputEdge.getOutputType();
    CodeGenOperatorFactory<RowData> operator = new NestedLoopJoinCodeGenerator(new CodeGeneratorContext(config.getTableConfig()), singleRowJoin, leftIsBuild, leftType, rightType, (RowType) getOutputType(), joinType, condition).gen();
    int parallelism = leftInputTransform.getParallelism();
    if (leftIsBuild) {
        parallelism = rightInputTransform.getParallelism();
    }
    long manageMem = 0;
    if (!singleRowJoin) {
        manageMem = config.get(ExecutionConfigOptions.TABLE_EXEC_RESOURCE_EXTERNAL_BUFFER_MEMORY).getBytes();
    }
    return ExecNodeUtil.createTwoInputTransformation(leftInputTransform, rightInputTransform, createTransformationName(config), createTransformationDescription(config), operator, InternalTypeInfo.of(getOutputType()), parallelism, manageMem);
}
Also used : NestedLoopJoinCodeGenerator(org.apache.flink.table.planner.codegen.NestedLoopJoinCodeGenerator) RowData(org.apache.flink.table.data.RowData) Transformation(org.apache.flink.api.dag.Transformation) ExecEdge(org.apache.flink.table.planner.plan.nodes.exec.ExecEdge) CodeGeneratorContext(org.apache.flink.table.planner.codegen.CodeGeneratorContext) RowType(org.apache.flink.table.types.logical.RowType)

Aggregations

Transformation (org.apache.flink.api.dag.Transformation)1 RowData (org.apache.flink.table.data.RowData)1 CodeGeneratorContext (org.apache.flink.table.planner.codegen.CodeGeneratorContext)1 NestedLoopJoinCodeGenerator (org.apache.flink.table.planner.codegen.NestedLoopJoinCodeGenerator)1 ExecEdge (org.apache.flink.table.planner.plan.nodes.exec.ExecEdge)1 RowType (org.apache.flink.table.types.logical.RowType)1