public SqlType getExpressionSqlType(final Expression expression) {
    return getExpressionSqlType(expression, Collections.emptyMap());
  }
@Test
  public void shouldHandleMultipleLambdasInSameFunctionCallWithDifferentVariableNames() {
    // Given:
    givenUdfWithNameAndReturnType("TRANSFORM", SqlTypes.INTEGER);
    when(function.parameters()).thenReturn(
        ImmutableList.of(
            MapType.of(LongType.INSTANCE, DoubleType.INSTANCE),
            IntegerType.INSTANCE,
            LambdaType.of(
                ImmutableList.of(
                    DoubleType.INSTANCE,
                    DoubleType.INSTANCE
                ),
                StringType.INSTANCE),
            LambdaType.of(
                ImmutableList.of(
                    DoubleType.INSTANCE,
                    DoubleType.INSTANCE
                ),
                StringType.INSTANCE
            )
        ));
    final Expression expression = new ArithmeticBinaryExpression(
        Operator.ADD,
        new FunctionCall(
            FunctionName.of("TRANSFORM"),
            ImmutableList.of(
                MAPCOL,
                new IntegerLiteral(0),
                new LambdaFunctionCall(
                    ImmutableList.of("A", "B"),
                    new ArithmeticBinaryExpression(
                        Operator.ADD,
                        new LambdaVariable("A"),
                        new LambdaVariable("B"))
                ),
                new LambdaFunctionCall(
                    ImmutableList.of("K", "V"),
                    new ArithmeticBinaryExpression(
                        Operator.ADD,
                        new LambdaVariable("K"),
                        new LambdaVariable("V"))
                ))),
        new IntegerLiteral(5)
    );

    // When:
    final SqlType result = expressionTypeManager.getExpressionSqlType(expression);

    assertThat(result, is(SqlTypes.INTEGER));
  }