public SqlType getExpressionSqlType(final Expression expression) {
    return getExpressionSqlType(expression, Collections.emptyMap());
  }
@Test
  public void shouldFailToEvaluateLambdaWithMismatchedArgumentNumber() {
    // Given:
    givenUdfWithNameAndReturnType("TRANSFORM", SqlTypes.DOUBLE);
    when(function.parameters()).thenReturn(
        ImmutableList.of(
            ArrayType.of(DoubleType.INSTANCE),
            LambdaType.of(
                ImmutableList.of(
                    DoubleType.INSTANCE
                ),
                StringType.INSTANCE
            )
        )
    );
    final Expression expression =
        new FunctionCall(
            FunctionName.of("TRANSFORM"),
            ImmutableList.of(
                ARRAYCOL,
                new LambdaFunctionCall(
                    ImmutableList.of("X", "Y"),
                    new ArithmeticBinaryExpression(
                        Operator.ADD,
                        new LambdaVariable("X"),
                        new IntegerLiteral(5))
                )));

    // When:
    final Exception e = assertThrows(
        Exception.class,
        () -> expressionTypeManager.getExpressionSqlType(expression)
    );

    // Then:
    assertThat(e.getMessage(), Matchers.containsString(
        "Was expecting 1 arguments but found 2, [X, Y]. Check your lambda statement."));
  }