public static CompiledLambda preGenerateLambdaExpression(
            LambdaDefinitionExpression lambdaExpression,
            String methodName,
            ClassDefinition classDefinition,
            Map<LambdaDefinitionExpression, CompiledLambda> compiledLambdaMap,
            CallSiteBinder callSiteBinder,
            CachedInstanceBinder cachedInstanceBinder,
            FunctionManager functionManager)
    {
        ImmutableList.Builder<Parameter> parameters = ImmutableList.builder();
        ImmutableMap.Builder<String, ParameterAndType> parameterMapBuilder = ImmutableMap.builder();

        parameters.add(arg("session", ConnectorSession.class));
        for (int i = 0; i < lambdaExpression.getArguments().size(); i++) {
            Class<?> type = Primitives.wrap(lambdaExpression.getArgumentTypes().get(i).getJavaType());
            String argumentName = lambdaExpression.getArguments().get(i);
            Parameter arg = arg("lambda_" + argumentName, type);
            parameters.add(arg);
            parameterMapBuilder.put(argumentName, new ParameterAndType(arg, type));
        }

        RowExpressionCompiler innerExpressionCompiler = new RowExpressionCompiler(
                callSiteBinder,
                cachedInstanceBinder,
                variableReferenceCompiler(parameterMapBuilder.build()),
                functionManager,
                compiledLambdaMap);

        return defineLambdaMethod(
                innerExpressionCompiler,
                classDefinition,
                methodName,
                parameters.build(),
                lambdaExpression);
    }
public static CompiledLambda preGenerateLambdaExpression ( LambdaDefinitionExpression lambdaExpression , String methodName , ClassDefinition classDefinition , Map < LambdaDefinitionExpression , CompiledLambda > compiledLambdaMap , CallSiteBinder callSiteBinder , CachedInstanceBinder cachedInstanceBinder , FunctionManager functionManager ) { ImmutableList . Builder < Parameter > parameters = ImmutableList . builder ( ) ; ImmutableMap . Builder < String , ParameterAndType > parameterMapBuilder = ImmutableMap . builder ( ) ; parameters . add ( arg ( "session" , ConnectorSession . class ) ) ; for ( int i = 0 ; i < lambdaExpression . getArguments ( ) . size ( ) ; i ++ ) { Class < ? > type = Primitives . wrap ( lambdaExpression . getArgumentTypes ( ) . get ( i ) . getJavaType ( ) ) ; String argumentName = lambdaExpression . getArguments ( ) . get ( i ) ; Parameter arg = arg ( "lambda_" + argumentName , type ) ; parameters . add ( arg ) ; parameterMapBuilder . put ( argumentName , new ParameterAndType ( arg , type ) ) ; } RowExpressionCompiler innerExpressionCompiler = new RowExpressionCompiler ( callSiteBinder , cachedInstanceBinder , variableReferenceCompiler ( parameterMapBuilder . build ( ) ) , functionManager , compiledLambdaMap ) ; return defineLambdaMethod ( innerExpressionCompiler , classDefinition , methodName , parameters . build ( ) , lambdaExpression ) ; }
@return a MethodHandle field that represents the lambda expression