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);
}
Aggregations