code: private Object invoke(ScalarFunctionImplementation function, ConnectorSession session, List<Object> arguments)
      {
          MethodHandle method = function.getMethodHandle();
  
          // handle function on instance method, to allow use of fields
          method = bindInstanceFactory(method, function);
  
          if (method.type().parameterCount() > 0 && method.type().parameterType(0) == ConnectorSession.class) {
              method = method.bindTo(session);
          }
          List<Object> actualArguments = new ArrayList<>();
          for (int i = 0; i < arguments.size(); i++) {
              Object argument = arguments.get(i);
              ArgumentProperty argumentProperty = function.getArgumentProperty(i);
              if (argumentProperty.getArgumentType() == VALUE_TYPE) {
                  if (function.getArgumentProperty(i).getNullConvention() == RETURN_NULL_ON_NULL) {
                      if (argument == null) {
                          return null;
                      }
                      actualArguments.add(argument);
                  }
                  else if (function.getArgumentProperty(i).getNullConvention() == USE_NULL_FLAG) {
                      boolean isNull = argument == null;
                      if (isNull) {
                          argument = Defaults.defaultValue(method.type().parameterType(actualArguments.size()));
                      }
                      actualArguments.add(argument);
                      actualArguments.add(isNull);
                  }
                  else {
                      actualArguments.add(argument);
                  }
              }
              else {
                  argument = asInterfaceInstance(argumentProperty.getLambdaInterface(), (MethodHandle) argument);
                  actualArguments.add(argument);
              }
          }
  
          try {
              return method.invokeWithArguments(actualArguments);
          }
          catch (Throwable throwable) {
              throw propagate(throwable);
          }
      }
docs: Arguments must be the native container type for the corresponding SQL types.
  <p>
  Returns a value in the native container type corresponding to the declared SQL return type